Centos7操作系统常规设置
1、网络类
安装ifconfig、arp等mii-tool等命令
1 | yum install -y net-tools |
安装图形化网络配置
1 | #nmtui 命令取代了 setup中的网络配置 |
安装nslookup命令
1 | yum install bind-utils -y |
网卡及网络信息
1 | ip n |
查看MAC地址
1 | arp -a |
查看路由
1 | route -n |
2、系统类
查看操作系统版本
1 | cat /etc/redhat-release |
查看操作系统内核版本
1 | uname -a |
时区和时间设置
1 | #时区配置方法1 |
语言设置
1 | #方法1 |
修改主机名
1 | vim /etc/hostname |
服务的管理和控制
1 | #systemctl是最主要的工具。它融合service 和chkconfig的功能于一体 |
服务启动与停止
1 | systemctl start service_name |
服务自启动
1 | systemctl enable service_name |
服务一览
1 | systemctl list-unit-files |
重载服务配置文件
1 | systemctl daemon-reload |
杀死服务
1 | systemctl kill --signal=9 sshd |
切换运行级别
1 | systemctl isolate multi-user.target |
关闭服务器
1 | init 0 |
重启服务器
1 | init 6 |
单用户模式
1 | systemctl rescue |
查看开机时间
1 | #查看看机时间 |
文件结构变化
1 | centos7的/bin, /sbin, /lib, and /lib64移到/usr下 |
通过repoquery查看rpm包中包含哪些文件
1 | yum install yum-utils |
3、优化类
内核参数配置文件
1 | #centos7采用文件夹引用方式加载配置 |
内核参数优化
1 | #filemax |
开机启动脚本需加X权限
1 | chmod +x /etc/rc.d/rc.local |
安装系统基本管理工具
1 | yum groupinstall "Development Tools" --setopt=group_package_types=mandatory,default,optional |
优化SSH相关配置
1 | vim /etc/ssh/sshd_config |
关闭防火强和setlinux
1 | #停止防火墙服务并取消开机自启 |