操作系统装置
略……
操作系统配置
网络配置
图形界面配置工具nmtui(centos7之前版本的setup)
配置文件
[root@bluse]#cat /etc/sysconfig/network-scripts/ifcfg-eth0NAME=eth0DEVICE=eth0TYPE=EthernetONBOOT=yesBOOTPROTO=noneDEFROUTE=yesIPADDR=172.16.90.22NETMASK=255.255.255.0GATEWAY=172.16.90.254IPV4_FAILURE_FATAL=noDNS1=172.16.90.53DNS2=114.114.114.114
确认ssh远程登陆
确认是否装置,并随机启动yum list installed | grep openssh-server systemctl status sshd
配置文件门路/etc/ssh/sshd_config,可按需配置
敞开selinux、敞开防火墙、敞开postfix
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/configsystemctl stop firewalldsystemctl disable firewalldsystemctl stop postfixsystemctl disable postfix
批改最大文件关上数
echo -e '* soft nofile 65535\n* hard nofile 65535\n* soft nproc 65535\n* hard nproc 65535' >> /etc/security/limits.conf
批改完后重启零碎,而后ulimit -n确认
装置常用工具
yum install -y vim wget lrzsz lsof zip unzip telnet net-tools bash-completion
更换yum源
mkdir /etc/yum.repos.d/backupmv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/backupwget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repowget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repoyum clean allyum makecache
批改主机名
hostnamectl set-hostname [IP]
配置history格局
/etc/profile
增加以下变量用于显示命令执行工夫
、用户名
、执行者IP
USER_IP=`who -u am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'` export HISTTIMEFORMAT="[%F %T][`whoami`][${USER_IP}]"
/etc/profile
中HISTSIZE=1000(默认值)可按需批改source /etc/profile
工夫同步
# 装置yum install -y chrony# 启用systemctl start chronydsystemctl enable chronyd# 设置时区timedatectl set-timezone Asia/Shanghai# 启用NTP同步timedatectl set-ntp yes
#查看同步源
chronyc sources
同步server可在配置文件中批改/etc/chrony.conf
附:对于分区
/boot 调配300M swap 依据物理内存大小调配,物理内存n≤4G时候2*n,4G≤n≤16G分n,n>16G分4G即可 /home 调配20G / 调配20G /data 残余