SSH
SSH
一括して PermitRootLogin no など
cat /etc/ssh/sshd_config | grep 'Include'
Include /etc/ssh/sshd_config.d/*.confsudo tee /etc/ssh/sshd_config.d/99-custom.conf << EOF
PermitRootLogin no
PubkeyAuthentication yes
PasswordAuthentication no
PermitEmptyPasswords no
EOFsudo systemctl restart sshdPasswordAuthentication no の動作確認
ssh -o PreferredAuthentications=password <target>port forward 利用時の connection refused メッセージを表示させない
-qオプションを利用する
ssh host.example -L '9090:127.0.0.1:9090` -qエラーの例
ssh -L '9090:127.0.0.1:9090'のようにポートフォワードを利用しているときに、リモート側でそのポートが待ち受けていないと、手元側で以下のようなメッセージが出力される
channel 7: open failed: connect failed: Connection refusedknown_hosts から特定のホストを削除
ssh-keygen -R 192.0.2.1
ssh-keygen -R host.exampleFreeBSD で PasswordAuthentication no にしても keyboard-interactive が残る
- 以下の設定が必要
- 環境
- FreeBSD 14.0-RELEASE-p3
- OpenSSH_9.5p1, OpenSSL 3.0.12 24 Oct 2023
# keyboard-interactive disable
ChallengeResponseAuthentication nossh-keygen
-f ./id_ed25519でファイル名を指定-C ""でコメントにホスト名を含めない
ssh-keygen -t ed25519 -f ./id_ed25519 -C ""最終更新日