ss:ネットワーク調査
One minute to read
正常だった場合→何も表示されません。 異常だった場合→/etc/sshd_config: line 131: Bad configuration option: sadfaijkm <–適当に入れた文字列が表示されました。 /etc/sshd_config: terminating, 1 bad configuration options 構文として怪しい列数と文字列を教えてくれるので便利です。
date +%Y%m%dPasswordAuthentication no
Subsystem sftp internal-sftp
Match Group sftponly PasswordAuthentication yes ForceCommand internal-sftp
hoge01で鍵無しでSSH接続ができない、鍵有りでSSH接続できることを確認。 hoge02でSSH接続時に拒否され、SFTP接続が行えることを確認。