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

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。