我要创建用户 test 并将我的.ssh / id_rsa.pub文件放在用户文件夹/home/test/.ssh/authorized_keys中 在我的/ etc / ssh / sshd_config文件中,我写下了下一条规则
Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 1024
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
PasswordAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
使用此配置,我可以与服务器连接。但是当我想用下一条规则限制用户 test 在他的文件夹中
Subsystem sftp internal-sftp
Match Group test
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no
我无法连接到服务器。我遇到下一个错误
packet_write_wait: Connection to my_ip port 22: Broken pipe
为什么?我该如何解决这个问题?