当前位置:首页 > linux运维 > 正文内容

linux 基线配置常用命令

14324472932年前 (2023-11-28)linux运维926
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

分享给朋友:
返回列表

没有更早的文章了...

下一篇:Docker配置可视化Portainer(汉化版)

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

nas 里好用的docker 推荐

1.adguard/adguardhome 这是一个广告拦截项目,具备dns功能,特别适合在局域网部署,防止dns污染和用于做开发测试的时候对测试域名进行host。 --restart unless-stopped\ -v /my/own/workdir:/opt/adguar...

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

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

openvpn服务端一键搭建

需求: 搭建openvpn目的是安全访问内网和匿名访问其他网站,确保隐私信息不会泄露。 搭建方法: 1.复制以下脚本命名为“openvpn-install.sh”,在ssh中执行。 #!/bin/bash # shellcheck disable=SC1091,SC2164,SC2034,...

docker镜像无法下载的解决方案

要更换Docker镜像仓库,您需要编辑Docker的配置文件,并将镜像仓库地址更改为您想要使用的地址。以下是在CentOS系统上更换Docker镜像仓库的一般步骤:1.连接到您的CentOS服务器,并使用文本编辑器(如vi或nano)打开Docker的配置文件/etc/docker/daemon.j...

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

支持内容:1.检查更新系统时间,并设置时区为北京时区。 #!/bin/bash # 更新系统时间(假设你有NTP服务或者可以访问互联网时间服务器) echo "Updating system time using NTP..." sudo timedatectl set-...

使用自定义docker加速地址下载镜像

1.例如加速地址为: https://docker.m.daocloud.io 2.配置docker加速地址 cat > /etc/docker/daemon.json <<EOF > {"registry-mirrors": ["https://docker.m...

发表评论

访客

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