| 您的当前位置:首页 --> CentOS入门 |
| CentOS下sshd 限制登陆设置 |
| 浏览次数:2519 关键词 ( CentOS sshd ) |
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. 设定登录黑名单 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登录 |
| 下载次数:21 |
| 下载地址:点击下载 |
| 本资源为程序自动采集,如有侵权请联系我们移除 admin#80vps.com 来信请将#替换为@ |
| 下一条 centos系统中网络配置相关 上一条 CentOS系统故障分析与排除 |