- 论坛徽章:
- 0
|
/etc/hosts.deny 不知道怎么限制用户级别,
可以用pam的access模块。下面的配置让test只能从192.168.1.*的局域网连接。
//File:"/etc/pam.d/sshd"
# Uncomment and edit /etc/security/access.conf if you need to set complex
# access limits that are hard to express in sshd_config.
#account required pam_access.so
account required pam_access.so debug
//File:"/etc/security/access.conf"
+:test:192.168.1.0/24
# allow other sshd_config
-:ALL EXCEPT user1 user2:ALL
最近看到可以把test用户配置成密钥登录,test设置成空密码,ssh配置空密码不能登录,然后在test的ssh公钥中加from="192.168.1.1,192.168.1.2" 等来限制只能某几台机器IP能登录test用户。 |
|