我有一台具有多个 IP 地址的服务器,每个 IP 地址上都托管着网站。我有一个 IP 地址没有与之关联的网站。我想仅允许 SSH 登录到没有与之关联的一个 IP 地址。这可能吗?如果可以,有人能告诉我如何实现吗?
答案1
查看 sshd_config 中的 ListenAddress。
ListenAddress
Specifies the local addresses sshd(8) should listen on. The
following forms may be used:
ListenAddress host|IPv4_addr|IPv6_addr
ListenAddress host|IPv4_addr:port
ListenAddress [host|IPv6_addr]:port
If port is not specified, sshd will listen on the address and all
prior Port options specified. The default is to listen on all
local addresses. Multiple ListenAddress options are permitted.
Additionally, any Port options must precede this option for non-
port qualified addresses.