sshでIP制限、ポート変更root拒否

トップオープンソースsshでIP制限、ポート変更root拒否

sshでIP制限、ポート変更root拒否

sshでIP制限、ポート変更root拒否

1.IP制限
(1)拒否 /etc/hosts.allow
ALL:ALL
 または
sshd:ALL

(2)指定のみ許可 /etc/hosts.allow
sshd:xxx.xxx.xxx.xxx

2.sshd /etc/ssh/sshd_config
(1)ポート変更
Port 22
 を
Port 12345
とかへ変更。

(2)root直接ログイン禁止
#PermitRootLogin yes
PermitRootLogin no

(3)指定ユーザのみ許可
AllowUsers abc

という感じでしょうか。

カテゴリ内の記事