最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
sshd 限制登陆的几种方法总结
时间:2017-04-03 编辑:简简单单 来源:一聚教程网
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=denyfile=/etc/sshd_user_deny_listonerr=succeed
所有/etc/sshd_user_deny_list里面的用户被拒绝ssh登录
-
下一个: xshell远程工具设置中文方法
相关文章
- SSH 框架简介 09-20
- Docker容器搭建基于ssh服务的镜像和容器 09-25
- python批量建立ssh key(密钥)认证 07-23
- backtrack 下启动ssh服务的步骤 05-02
- SSH 搭建 SOCKS Privoxy代理服务器 11-12
- python中pexpect模块封装ssh示例 10-20