如何只允许某些用户从特定网络接口登录到 SSH 服务器?
例如
无法使用,AllowUsers user1@eth0因为 AllowUsers 采用主机名而不是接口名称。
本网站上的其他答案建议如下:
Match address 1.2.3.4/16 # eth0's network
AllowUsers user1
Match address 2.3.4.5/16 # eth1's network
AllowUsers user1,user2
Match address 0.0.0.0/0 # Match's equivalent of a closing brace?
Run Code Online (Sandbox Code Playgroud)
但是,如果 eth0 使用 DHCP 服务器来获取其地址,那么它事先并不知道 1.2.3.4 是放入 sshd_config 的正确地址。
(如果有所不同,请在 Ubuntu 12.04 上使用 OpenSSH)
使用 RAID1 时,最好的做法是在购买原始磁盘的同时购买备用磁盘以确保您拥有相同的类型,以防将来它们不可用吗?