SSHDの設定方法
更新日:
投稿日:
投稿日:
確認環境
Ubuntu 22.04.3 LTS
設定ファイルのありか
/etc/ssh/sshd_config
公開鍵認証にする
SSHD側に公開鍵を置き、クライアント側からは秘密鍵でアクセスする
sudo nano /etc/ssh/sshd_configで以下の設定に変更PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys PasswordAuthentication no PermitEmptyPasswords no鍵置き場を作る
mkdir ~/.ssh/公開鍵を書き込む
echo "公開鍵" > ~/.ssh/authorized_keys
備考
/etc/ssh/sshd_configのPortもデフォルトの22から別の場所に変えておくとより良い。