SSH 環境設定

rootログイン不許可

PermitRootLogin no
ちなみに、 PasswordAuthentication yesにてユーザログインを許可し、rootのみ鍵認証の場合は、
PermitRootLogin without-password
鍵認証のみ
PasswordAuthentication no
ポート変更
/etc/ssh/sshd_config
#Port 22
Port 10022
ユーザ指定ログイン
# userのみだけログイン許可
AllowUser user
特定ログイン
# 外部ネットワークからの接続には公開鍵認証のみを有効とする
PasswordAuthentication no

# 内部ネットワークからの接続に限りパスワード認証を許可する
Match Address 192.168.1.*
PasswordAuthentication yes

それぞれ、変更したら、SSHを再起動
/etc/init.d/sshd restart

タイトルとURLをコピーしました