本文共 2460 字,大约阅读时间需要 8 分钟。
系统基本配置
建议修改系统环境英文,通过SSH远程工具管理不会出现乱码
vi /etc/sysconfig/i18nLANG=”en_US”建议关闭SELINUX
vi /etc/sysconfig/selinux一、网络配置
1、通过网卡配置文件配置vi /etc/sysconfig/network-scripts/ifcfg-eth02、修改计算机名vi /etc/sysconfig/network3、配置DNSvi /etc/resolv.conf配置完成后重新启动网络服务service network restart4、通过菜单配置网络---TAB切换setup配置IP
[root@localhost /]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0TYPE=EthernetUUID=f90d9f87-dc35-4c67-863d-76c8d15f1e4aONBOOT=yesNM_CONTROLLED=yesBOOTPROTO=noneHWADDR=50:46:5D:73:3C:22IPADDR=192.168.2.18PREFIX=24GATEWAY=192.168.2.1DEFROUTE=yesIPV4_FAILURE_FATAL=yesIPV6INIT=noNAME="System eth0"配置计算机名
[root@localhost /]# vi /etc/sysconfig/networkNETWORKING=yesHOSTNAME=manager配置DNS
[root@localhost /]# vi /etc/resolv.conf nameserver 61.139.2.69配置本地yum源
[root@localhost yum.repos.d]# vi local.repo[local]name=localbaseurl=file:///var/centos6.8/enabled=1gpgcheck=0[root@localhost yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, securityCleaning repos: base extras local updatesCleaning up Everything[root@localhost yum.repos.d]# yum makecache关闭SElinux
[root@localhost yum.repos.d]# vi /etc/selinux/config SELINUX=disabledSELINUXTYPE=targeted更新服务器时间
[root@localhost yum.repos.d]# ntpdate time.windows.com && hwclock -w && hwclock --systohc14 Jun 16:38:40 ntpdate[2300]: adjust time server 40.69.40.157 offset -0.015351 sec关闭不用的服务
查看不用的服务
[root@localhost yum.repos.d]# chkconfig --list |egrep -v "crond |haldaemon |iptables |irqbalance |messagebus |netfs |network |rsyslog |sshd |sysstat |udev-post"编写脚本处理
[root@manager sh]# cat chkconfig.sh #!/bin/bash# close service allfor s1 inchkconfig --list |egrep -v "crond |haldaemon |iptables |irqbalance |messagebus |netfs |network |rsyslog |sshd |sysstat |udev-post" |awk '{print $1}'
dochkconfig $s1 offdone 创建普通用户
[root@manager sh]# useradd xk[root@manager sh]# passwd xkChanging password for user xk.New password: Retype new password: passwd: all authentication tokens updated successfully.授权普通用户管理
[root@manager sh]# visudoroot ALL=(ALL) ALLuser ALL=(ALL) ALL调整文件描述符
[root@manager sh]# vi /etc/security/limits.conf # soft core 0# hard rss 10000#@student hard nproc 20#@faculty soft nproc 20#@faculty hard nproc 50#ftp hard nproc 0#@student - maxlogins 4[root@manager ~]# ulimit -n
65535清除登录时显示内核信息
[root@manager ~]# echo >/etc/issue[root@manager ~]# echo >/etc/redhat-release转载于:https://blog.51cto.com/zhizhimao/2323069