only allow a few accounts can logon Linux by telnet/ssh/rsh
1, edit /etc/pam.d/system-auth
[root@xabuild1 ~]# head -n 4 /etc/pam.d/system-auth | grep -v ^#
auth required /lib/security/$ISA/pam_listfile.so item=user sense=allow file=/etc/allowusers onerr=succeed
[root@xabuild1 ~]#
2, add one line to /etc/pam.d/ssh(rsh)
[root@xabuild1 ~]# head -n 5 /etc/pam.d/sshd | grep -v ^#
auth include system-auth
[root@xabuild1 ~]#
3, Added accounts in /etc/allowusers:
[root@xabuild1 ~]# cat /etc/allowusers
cnbuild
tfan
liwang
llhu
dfguo
jfwang
sgzhang
tang
swu
engbuild
[root@xabuild1 ~]#
that's ok.
Note the step 2.
阅读(1213) | 评论(0) | 转发(0) |