LoginSignup
4
2

More than 3 years have passed since last update.

[Catalina] Mac の OpenSSH Server を公開鍵認証のみにする

Posted at

準備

リモートログインを有効化する前に /etc/ssh/sshd_config を編集します.

  • ルートログインの無効化(デフォルトはパスワード認証のみ無効)
- #PermitRootLogin prohibit-password
+ PermitRootLogin no
  • パスワード認証を無効化
- #PasswordAuthentication yes
+ PasswordAuthentication no
  • チャレンジレスポンス認証を無効化
- #ChallengeResponseAuthentication yes
+ ChallengeResponseAuthentication no

編集後に SSH サーバの再起動等は不要です.

リモートログイン

[システム環境設定] -> [共有] で「リモートログイン」を有効化します.
「Administrators」ではなく特定のユーザのみに制限することも可能です.

スクリーンショット 2020-01-28 13.04.39.png

おまけ

特定の IP アドレスからのみパスワード認証を有効化したい場合は /etc/ssh/sshd_config の最後に以下のような追記をしましょう.

Match Address 10.1.0.0/16
    PasswordAuthentication yes
4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2