I'm getting the following error while trying to connect to server via sftp : "client_loop: send disconnect: Broken pipe" Could someone help me ?
Server : Ubuntu 22.04 lts
1. chown -hR root:root /mnt : -> make root the owner of /mnt and all its sub directories
2. chmod 755 -R -f /mnt : -> set permissions
3. groupadd users : -> add group
4. adduser --home /mnt/disk2/users/jo jo - > make user's Home
5. usermod -a -G users jo : -> add user to group
6. chown -hR jo:jo /mnt/disk2/users/jo : -> give ownership to jo
7. chmod -R 775 /mnt/disk2/users/jo : -> set permissions
nano /etc/ssh/sshd_config
Match group users
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no
Reboot
In "/etc/ssh/sshd_config" if I change "ChrootDirectory %h" to "ChrootDirectory /mnt/disk2/users", I can login, but it is not restricted to jo's home, as I wanted.
Kind Regards,
Jo