SSH and CHROOT to USER home directory ERROR

For quick answers: Does my idea even work?


  • Total voters
    1
Status
Not open for further replies.

arctic

Cadet
Joined
Oct 20, 2016
Messages
2
Hey!
So I've been fiddling around and trying to get the USER rooted to the USER dataset and not the branch before.
User in question - ftpuser
ftpuser has primary group 'ftpuser' and auxillary group 'sftp' which is used as reference for the SSH match block.

What happens is that if I set the home directory of the USER to be '/mnt/MirrorVolume/sftp/ftpuser' and if I set the extra options in ssh to:

5ako40.png


I get the ERROR when trying to connect to it through FileZilla/WinSCP: Server unexpectedly closed network connection.

Storage:
14jm7av.png

Permissions:
MirrorVolume: rwx r-x r-x root:wheel
sftp: rwx r-x r-x root:wheel
sftp/ftpuser: rwx r-x r-x ftpuser:ftpuser

I can make the connection work by making the home directory of the 'ftpuser' to '/mnt/MirrorVolume/sftp' which lets it connect but I don't wish to do so as the ftpuser will be able to see other users directories such as the 'sftp/arctic' directory.

So if was wondering if I am able to make the root of the ftpuser be 'sftp/ftpuser' instead of just 'sftp'?

Thanks in advance, tell me if you need more some kind of info to understand.

Freenas version: FreeNAS-9.10.1-U2 (f045a8b)
 

arctic

Cadet
Joined
Oct 20, 2016
Messages
2
Were you able to figure this out?
I did not find a specific solution for it so I did a cheaty work-around by making a folder inside the users folder with the same name, only with the permissions set for the user. So now it looks like this:

sftp/ftpuser/ftpuser
with the first ftpuser folder having root and sftp_admin (so I can access it with my own account for checking on the folders) while the second one is set to owner = ftpuser and group to sftp_admin

I can now root them in their own little private area while they only have write access in the second user folder.

Hope this explains my work around and maybe gives you some inspiration :)
 
Status
Not open for further replies.
Top