0

I'm trying to setup SFTP on my ubuntu server and I'm encountering a problem. When I set up a group in sshd_config file to chroot people to their home directories the user in the group cannot access the server via SSH and this error comes up "software caused connection abort" and sometimes "No directory found".

I'm pretty sure it is to do with permissions but I'm not sure what. I've disabled the UFW for testing so it isn't that. Any help would be gratefully appreciated. Thanks.

Here's what I added to the sshd_config file:

Match Group webadmins
    ChrootDirectory %h
    X11Forwarding no
    AllowTopForwarding no

I left these bottom two commented as I'm just concerned about the ChrootDirectory.

Archemar
  • 672

2 Answers2

0

If you're chrooting the users, you should either use ForceCommand internal-sftp or set up a shell (along with everything it needs) in each home directory. If neither of these was done, SSH won't be able to login the user.

muru
  • 197,895
  • 55
  • 485
  • 740
0

The directory you are chrooting (in your case %h) should be owned by user root. Use command sudo chown root.root %h

bbpd
  • 1