Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

sftp Broken pipe Couldn't read packet: Connection reset by peer

Writer Matthew Martinez

I am trying to setup a sftp account to a specific folder. I have created a group ftpaccess and user testuser with home directory as seen here:

sudo addgroup ftpaccess
sudo useradd -d /home/forge/ -m testuser -g ftpaccess -s /bin/false
sudo passwd testuser
sudo chown root:root /home/forge/
sudo chmod 755 /home/forge/

Then I have created an transfers directory inside testuser home folder:

sudo mkdir /home/forge/
sudo chown testuser:ftpaccess /home/forge/

Then I have setup sshd_config like this (rules added to the end of file):

# SFTP account
Subsystem sftp internal-sftp
Match group ftpaccess
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
PasswordAuthentication yes

Now trying to sftp with this user sftp testuser@localhost but I get error:

packet_write_wait: Connection to 127.0.0.1 port 22: Broken pipe
Couldn't read packet: Connection reset by peer

What am I doing wrong?

4

1 Answer

Please try moving Subsystem sftp internal-sftp line from your existing block to # override default of no subsystems in sshd_config

It worked for me.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy