麒麟操作系统安装手册 下载本文

用tab键切换到“确认”保存。 4) 进入“防火墙配置”,将“防火墙”前面的“*”按空格键取消掉;用tab键切换到

“确认”保存。

5) 选择退出,退出文本工具。

33 / 47

4.5 修改密码策略

修改/etc/pam.d/system-auth文件,禁用复杂密码,允许使用简单密码。 [root@smart etc]#vi /etc/pam.d/system-auth

34 / 47

将红色字体的内容注释掉;新增蓝色字体的内容

#password required pam_passwdqc.so min=disabled,40,8,8,8 max=40 retry=3 password required pam_cracklib.so try_first_pass retry=99

使用“passwd+用户名”的方式修改密码。

4.6 内核参数配置

内核参数的配置即为修改sysctl.conf文件。

[root@smart etc]#vi /etc/sysctl.conf ---在该文件中增加以下内容

net.ipv4.neigh.default.gc_thresh1=512 net.ipv4.neigh.default.gc_thresh2=2048 net.ipv4.neigh.default.gc_thresh3=4096

net.ipv4.ip_local_port_range=1024 65535 net.core.rmem_max=16777216 net.core.wmem_max=16777216

net.ipv4.tcp_rmem=4096 87380 16777216 net.ipv4.tcp_wmem=4096 65536 16777216 net.ipv4.tcp_fin_timeout=10 net.ipv4.tcp_tw_recycle=1 net.ipv4.tcp_timestamps=0

net.ipv4.tcp_window_scalling=0

35 / 47

net.ipv4.tcp_sack=0

net.core.netdev_max_backlog=30000 net.ipv4.tcp_no_metrics_save=1 net.core.somaxconn=262144

net.ipv4.tcp_max_orphans=262144 net.ipv4.tcp_max_syn_backlog=262144 net.ipv4.tcp_synack_retries=2 net.ipv4.tcp_syn_retries=2 vm.overcommit_memory=1 fs.file-max=2000000 fs.nr_open=2000000

保存退出后,重启或以root用户执行“sysctl -p”验证并使参数生效。 [root@smart etc]#sysctl –p

设置成功,则正确输出sysctl中的内容。

4.7 修改资源限制

打开文件配置/etc/security/limits.conf ---在该文件中增加以下内容

smart soft nproc 4096 smart hard nproc 16384 smart soft nofile 65536 smart hard nofile 65536

//ulimit -a显示用户可以使用的资源限制

4.8 NTP对时配置

特别说明:ntpd服务和ntpdate服务是互斥的,在配置时需注意区分。

4.8.1 Ntp服务器配置

红色字体是需要保留的内容。 蓝色字体是可选择是否保留。 1) 修改ntp.conf配置文件

[root@smart etc]#vi /etc/ntp.conf

# For more information about this file, see the man pages

# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift

36 / 47