鍵認証SSHのUbuntuサーバーで特定ユーザーのみSFTPでパスワード認証する


Ubuntu 24.04

設定ファイルの末尾に下記を追記する。

Match User username
        PasswordAuthentication yes
        X11Forwarding no
        AllowTcpForwarding no
        PermitTTY no
        ForceCommand internal-sftp
        ChrootDirectory /data/

サービスをリロードする。

# systemctl reload ssh