linux禁止tty终端登陆

修改文件/etc/pam.d/system-auth

#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
#auth required pam_env.so
#auth sufficient pam_unix.so nullok try_first_pass
#auth requisite pam_succeed_if.so uid >= 500 quiet
#auth required pam_deny.so
#
auth required pam_env.so
auth required pam_tally.so onerr=fail per_user deny=3 unlock_time=60
auth sufficient pam_unix.so try_first_pass
auth required pam_deny.so
#
#account required pam_unix.so
#account sufficient pam_succeed_if.so uid < 500 quiet
#account required pam_permit.so
account required pam_tally.so
account required pam_unix.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
#
#password requisite pam_cracklib.so try_first_pass retry=3 lcredit=-2 ucredit=-2 dcredit=-2 ocredit=-2
#password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok remember=5
#password required pam_deny.so
password requisite pam_cracklib.so minlen=7 ucredit=-2 lcredit=-1 dcredit=-1 ocredit=-2 retry=3
password sufficient pam_unix.so use_authtok md5 shadow remember=5
password required pam_deny.so
#
#session optional pam_keyinit.so revoke
#session required pam_limits.so
#session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
#session required pam_unix.so
##Set account retries to three for GEN000460
#account required pam_tally.so deny=3 no_magic_root reset
session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so

posted @ 2015-05-05 11:05  侠客书生  阅读(1764)  评论(0编辑  收藏  举报