手机看片精品高清国产日韩,色先锋资源综合网,国产哺乳奶水91在线播放,乱伦小说亚洲色图欧洲电影

sshd 限制登陸的幾種方法總結(jié)

2017-03-08 08:18:28 8013

1. 在 /etc/hosts.allow 寫:

在/etc/hosts.allow寫:
sshd: 1.2.3.4
在 /etc/hosts.deny 寫:
sshd: ALL

 

2. 用 iptables 也行:

iptables -I INPUT -p tcp --dport 22 -j drop
iptables -I INPUT -p tcp --dport 22 -s 1.2.3.4 -j ACCEPT

3. 禁止某個用戶通過ssh登錄

在/etc/ssh/sshd_conf添加
AllowUsers 用戶名
或者
AllowGroups 組名
或者
DenyUsers 用戶名

 


4. 設(shè)定登錄黑名單

vi /etc/pam.d/sshd
增加
auth required /lib/security/pam_listfile.so item=user sense=deny file=/etc/sshd_user_deny_list onerr=succeed
所有/etc/sshd_user_deny_list里面的用戶被拒絕ssh登錄

提交成功!非常感謝您的反饋,我們會繼續(xù)努力做到更好!

這條文檔是否有幫助解決問題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進一步的反饋信息:

在文檔使用中是否遇到以下問題: