允许使用ssh连接到我的Debian Wheezy服务器的两个(unix)用户:git和peter。虽然git可以从任何地方进行连接,但是应该仅允许peter(属于sudo组)从我的本地网络进行连接。
因此,我添加了这一行
允许用户git [email protected]/24
到我的/ etc / ssh / sshd_config
它首先似乎可以正常工作,因为git可以通过Internet远程连接,而peter则不能。
IP地址为192.168.2.24的桌面可以作为peter进行连接,但使用VPN(本地IP为192.168.2.201)连接时,笔记本电脑却无法连接。当使用它直接连接到我的局域网时,它可以工作。
这是我可以在/var/log/auth.log文件中找到的内容。对我来说没有任何意义,为什么不允许使用IP?
2月2日11:44:54 srv sshd [7275]:不允许来自192.168.2.201的用户peter,因为未在AllowUsers中列出
2月2日11:44:54 srv sshd [7275]:input_userauth_request:无效的用户peter [preauth]
使用:
AllowUsers git [email protected].*
或例如:
AllowUsers git [email protected]??
如果仅将200-254分配给VPN连接。
并确保阅读man ssh_config
(模式部分)。是的,那ssh_config
不是sshd_config
。但是,如果您阅读后者,您会发现它指的是前者。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句