localhostインスタンスからSFTPにアクセスするための「client_loop:切断された転送:壊れたパイプ」

localhostインスタンスからSFTPにアクセスするための「client_loop:切断された転送:壊れたパイプ」

システムはローカルで実行されているSFTPインスタンスを使用してデフォルトでシンボリックリンクに設定されているNFS共有にディレクトリをマウントします/var/sftpが、SFTPライブラリを使用して接続しようとすると、接続が失敗するSFTPの異常な構成が継承されました。

debug1: identity file /home/testuser/.ssh/id_ecdsa type -1
debug1: identity file /home/testuser/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.9
debug1: SSH2_MSG_KEXINIT sent
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /home/testuser/.ssh/id_rsa
debug1: Will attempt key: /home/testuser/.ssh/id_dsa
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/testuser/.ssh/id_ecdsa_sk
debug1: Trying private key: /home/testuser/.ssh/id_ed25519
debug1: Trying private key: /home/testuser/.ssh/id_ed25519_sk
debug1: Trying private key: /home/testuser/.ssh/id_xmss
debug1: Next authentication method: password
testlab1@localhost's password:
debug1: Authentication succeeded (password).
Authenticated to localhost ([127.0.0.1]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
client_loop: send disconnect: Broken pipe
Connection closed.
Connection closed

SFTP命令を使用してテストを行うと、client_loop: send disconnect: Broken pipe上記のように終了します。私の最初の研究によると、これはシンボリックリンクを介して制御できない権限の問題です。シンボリックリンク内のサブディレクトリは0755に設定されており、親シンボリックリンクと同じユーザーに属していませんが、rootsshd_configにaが設定されているsftpグループの一部です。Match Group同様にChrootDirectory、sshd_configでも%hに設定されています。

$ ls -aluth
lrwxrwxrwx  1 root root   36 Dec 13 18:05 directory -> /mnt/nfs1/target-directory
drwxr-xr-x  3 root root 4.0K Dec 13 16:18 .
drwxr-xr-x 15 root root 4.0K Dec 12 20:05 ..

ここで問題はシンボリックリンク権限と同じくらい簡単ですか?それでは、このリンクのディレクトリへのSFTP接続を許可する回避策はありますか?

ベストアンサー1

おすすめ記事