sftp and chroot on debian

0

I am experimenting with a server running Debian. It should replace my aging Apple server (and since the new Apple server is not a server anymore that is no longer an option).

So far everything goes fine, but I have a problem placing a user in chroot jail for sftp access. I am following this guide.

This goes well, but when I connect with a ftp client (cyberduck in this case) I arrive in the folder /sftp/guestuser/. I am not able to do anything in this folder, therefore (still following the guide) there is a folder 'incoming' inside the /sftp/guestuser directory where I can put/get files etc. But I know this will be confusing to my clients.

They just want to log in to a given sftp address and put/get the files they want. I have played around a bit with permissions and ownerships but I cannot find a way to get directly to the directory where I can actually do something.

After following the guide the guestuser directory that I go to after sftp-ing to the server has root:root ownership, the 'incoming' directory is guestuser:sftpusers, where sftpusers is the chrooted group for sftp in sshd_config. The guide is from 2012, but I guess the principles are still the same.

What am I doing wrong?

ArjenA

Posted 2020-02-27T10:28:14.873

Reputation: 1

Please check first if the guestuser's home directory is set to /incoming. The output of

grep guestuser /etc/passwd

Should be like: guestuser:x:1002:1000::/incoming:/sbin/nologin

If the home directory is not /incoming then

usermod guestuser -d /incoming

changes it to /incoming.

A client conntection to the sftp-server as guestuser should now end up in /incoming – conditioHumana – 2020-02-27T11:27:07.817

No answers