準備
リモートログインを有効化する前に /etc/ssh/sshd_config
を編集します.
- ルートログインの無効化(デフォルトはパスワード認証のみ無効)
- #PermitRootLogin prohibit-password
+ PermitRootLogin no
- パスワード認証を無効化
- #PasswordAuthentication yes
+ PasswordAuthentication no
- チャレンジレスポンス認証を無効化
- #ChallengeResponseAuthentication yes
+ ChallengeResponseAuthentication no
編集後に SSH サーバの再起動等は不要です.
リモートログイン
[システム環境設定] -> [共有] で「リモートログイン」を有効化します.
「Administrators」ではなく特定のユーザのみに制限することも可能です.
おまけ
特定の IP アドレスからのみパスワード認証を有効化したい場合は /etc/ssh/sshd_config
の最後に以下のような追記をしましょう.
Match Address 10.1.0.0/16
PasswordAuthentication yes