当前位置:首页 > linux运维

linux 基线配置常用命令

14324472932年前 (2023-11-28)linux运维1082
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 基线配置常用命令” 的相关文章

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

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

旁路由模式下(群晖或其他设备)docker无法访问hub.docker.com解决方案

旁路由模式下(群晖或其他设备)docker无法访问hub.docker.com解决方案

1.使用openwrt中的passwall插件,配置好其他相关数据后,在此处Socks配置中配置。 配置好后当状态为两个对号表示配置成功。 此时旁路由即开启了http端口,使用方式为:旁路由ip:3434 如果使用群晖,在群晖:控制面板-网络-常规中配置代理无服器即可 ![](https://ww…

CentOS优化手册

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

nginx 和frp共存端口转发规则

```bash server { listen 80; listen [::]:80; server_name *.lovekf.cn; location / { proxy_pass http://127.0.0.1:81; proxy_redirect http://$host/ http:/…

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

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

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

1.例如加速地址为:https://docker.1ms.run2.配置docker加速地址cat > /etc/docker/daemon.json <<EOF > {"registry-mirrors":&nb…

发表评论

访客

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