当前位置:首页 > linux运维

linux 基线配置常用命令

14324472933年前 (2023-11-28)linux运维1348
vi /etc/selinux/config
SELINUX=disabled

vi /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 =1
net.ipv6.conf.default.disable_ipv6 =1



关闭图形化界面
systemctl set-default multi-user.target 
reboot

临时开启图形化
startx



yum install epel-release -y

yum clean all

yum install epel-release -y
这是为了确认epel源最新

yum makecache fast
yum makecache
yum update -y


yum install -y gcc gcc-c++ glibc make automake autoconf zlib zlib-devel pcre-devel  perl perl-Test-Simple openssl-devel pam-devel vim  firewalld  htop iftop nmap screen telnet tree cmake ntp lrzsz



echo -e "export.UTF-8" >> /etc/bashrc

timedatectl set-timezone Asia/Shanghai



systemctl enable ntpd
systemctl start ntpd

ntpdate -u ntp1.aliyun.com

systemctl restart ntpd

ntpq -p
ntpstat 

crontab -e
0 8,12 * * * /usr/sbin/ntpdate ntp1.aliyun.com && /usr/sbin/clock -w >> /var/log/history/ntpdate.log
保存并退出。
使用crontab -l查看命令是否保存。
systemctl start crond
systemctl enable crond

0 8,12 * * * /home/youzi/date.sh >> /home/youzi/log/history/ntpdate.log


systemctl start firewalld
systemctl enable firewalld
systemctl stop firewalld
systemctl disable firewalld

firewall-cmd --set-default-zone=trusted
firewall-cmd --reload


扫描二维码推送至手机访问。

版权声明:本文由爱开发博客发布,如需转载请注明出处。

本文链接:https://www.lovekf.cn/?id=8

分享给朋友:

“linux 基线配置常用命令” 的相关文章

自建dns服务器

自建dns服务器:项目来源:AdguardTeam/AdGuardHome: Network-wide ads & trackers blocking DNS server (github.com)我建立的DNS:1.15.64.27:53特点:本dns服务器主要解决的是DNS污染问题,顺便…

Xray VLESS+TCP+XTLS/TLS+Nginx+WebSocket 一键安装脚本 By wulabing

Xray VLESS+TCP+XTLS/TLS+Nginx+WebSocket 一键安装脚本 By wulabing

Xray 基于 Nginx 的 VLESS + XTLS 一键安装脚本,支持VLESS + TCP + TLS + Nginx + VLESS + TCP + XTLS / TLS + Nginx等多种组合一键安装,系统支持Debian 9+ / Ubuntu 18.04+ / Centos7+ /…

自建内网穿透服务器-基于Docker的FRP内网穿透部署

创建配置文件# 创建存放目录 sudo mkdir /etc/frp # 创建frps.ini文件 vim /etc/frp/frps.tomlfrps.toml文件配置内容[common] # 监听端口 bind_port&nb…

aria2配置文件和bt-tracker定期更新脚本

# # https://github.com/P3TERX/aria2.conf # File name:aria2.conf # Description: Awesome Aria2 configuration file # Version: 2021.09.15 # # Copyright (c…

CentOS优化手册

1. 调整 journal 存储设置( 解决systemd 或者 systemd-journald 进程占用大量 CPU 或内存资源的情况)编辑 /etc/systemd/journald.conf 文件,并更改 Storage 参数。例如,将其从 persistent 改为 volatile 或…

linux基线配置脚本(自己更具需求书写,并不适合所有人)

支持内容:1.检查更新系统时间。 ```bash#!/bin/bash 更新系统时间(假设你有NTP服务或者可以访问互联网时间服务器)echo “Updating system time using NTP…”sudo timedatectl set-ntp true 检查是否成功设置…

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。