You need enabled pam_access module first. Uncomment the following line in
/etc/pam.d/login and
/etc/pam.d/sshd files:
account required pam_access.so
Secure Administrative Logins
Modify
/etc/security/access.conf to disallow remote logins to administrative accounts, disallow local logins to non-administrative account. The order of entries is
important:
- : ALL EXCEPT root : tty1
+ : root : tty1
- : ALL : LOCAL
- : root : ALL
Secure Network Logins
Setup a group to control users who can access the system remotely (via ssh).
groupadd -r sshusers
Modify
/etc/security/access.conf in order to allow only
sshusers group network access.
+ : (sshusers) : ALL
- : ALL : ALL
Add users to group
sshusers:
usermod -a -G sshusers user1
The changes take place immediately, you do not have to reboot.
No comments :
Post a Comment