sFTP jail set-up & changing home directories
so I was following this guideforum topic
And I've come across an issue I can't fix.
Here's what I want to do:
I have a user with a home directory. Let's call the user "bossuser" and so his home directory is /home/bossuser.
Within that home directory there are three other directories.
Then I create three new users: "dummyuser1" "dummyuser2" and "dummy_user3".
These three users home directories are supposed to be the three directories in the home directory of "boss_user".
When "dummyuser1" connects via sFTP I want him to be jailed into his home directory (which is within the home directory of "bossuser").
So what I did was:
adduser dummy_user1
usermod -d /home/boss_user/dir1 -m dummy_user1
Put this into the sshd_config:
Match user dummy_user1
ChrootDirectory /home/boss_user/dir1
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
And following that I executed:
chmod 755 /home/boss_user/dir1
Then I restarted SSH, with:
service ssh restart
What I get when trying to connect with my "dummy_user1" with FileZilla is:
Error: Network error: Software caused connection abort
Error: Could not connect to server
How do I fix this issue? I haven't been using linux for too long, so I might have made some stupid mistakes. Just can't figure out what I'm doing wrong here.
Greetz,
- Mercury
Edit: If I remove that part:
<code>[code]Match user dummy_user1
ChrootDirectory /home/boss_user/dir1
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp<e>[/code]</e></code>
The user can connect, but (of course, as expected) is not jailed to his home directory.
5 Replies
Having root own "/home/boss_user" makes it work.
But will boss_user not owning his own home directory cause issues? Or can there be two owners?
Thanks so far!
Greetz,
- Mercury
My solution is to create another directory owned by bossuser. Something like "/home/bossuser/dir1/dir1" which is not quite what I wanted but I guess it's good enough.
If you have any other suggestions I'd be more than happy to test them. Will keep checking this thread for a while.
Thanks a lot for your help!
Greetz,
- Mercury