操作系统安装略...操作系统配置网络配置图形界面配置工具nmtui(centos7之前设置)配置文件[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.114Confirmsshremoteloginsystemctlconfirmpath/sshremoteloginsystemctl安装和服务器配置文件路径ssh/sshd_config,可以根据需要配置关闭selinux,关闭防火墙,关闭postfixsed-is/SELINUX=enforcing/SELINUX=disabled/g/etc/selinux/configsystemctlstopfirewalldsystemctldisablefirewalldsystemctlstoppostfixsystemctldisablepostfix修改最大打开文件数echo-e'*softnofile65535\n*hardnofile65535\n*softnproc65535\n*hardnproc65535'>>/etc/security/limits.conf修改后重启系统,然后ulimit-n确认安装常用工具yuminstall-yvimwgetlrzszlsofzipunziptelnetnet-toolsbash-completionreplaceyumsourcemkdir/etc/yum.repos.d/backupmv/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/backupwget-O/etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-7.repowget-O/etc/yum.repos.d/epel.repohttp://mirrors.aliyun.com/repo/epel-7.repoyumcleanallyummakecachemodifyhostnamehostnamectlset-hostname[IP]configurehistoryformat/etc/profile添加如下变量显示命令执行时间,用户名,执行者IPUSER_IP=`who-uami2>/开发/空|awk'{print$NF}'|sed-e's/[()]//g'`exportHISTTIMEFORMAT="[%F%T][`whoami`][${USER_IP}]"HISTSIZE=1000in/etc/profile(默认值)可以根据需要修改source/etc/profiletimesynchronization#安装yuminstall-ychrony#启用systemctlstartchronydsystemctlenablechronyd#设置时区timedatectlset-timezoneAsia/Shanghai#启用NTP同步timedatectlset-ntpyes#查看同步源chronycsources同步服务器可以修改配置文件中的/etc/chrony.conf。附:关于partition/boot分配300Mswap按照物理内存大小分配,物理内存n≤4G时分2*n,4G≤n≤16G分n,n>16G分4G。/home分配20G/分配20G/data剩余
