amuck-landowner

Debian: SFTP/SCP access, but no bash access

trexos

New Member
Hello,


I would like to transfer files over SFTP and SCP, I made my custom scripts for that and they work great. But I don't want the users who transfer the files to have access to the bash and I like them to be jailed in a specific (I prefer their home) directory. I googled a bit and found that this is possible with the default openssh server. I used this tutorial: http://blog.swiftbyte.com/linux/allowing-sftp-access-while-chrooting-the-user-and-denying-shell-access/

It works great, but only for SFTP. I cannot access files over SCP. Is there a way to make them accessable over openssh for SCP too?

Then I found rssh, it works great for SFTP and SCP as well, but the user can still access files which are located in /etc/ for example. I know that there is the way of jail them with CHroot. But it looks very difficult and I'm new with Linux. So Is there an easy way to solve my problem?

Thank you in advance! :)
 

trexos

New Member
We have a tutorial here that covers your part:
Well, thank you. But this is just another tutorial of how I can use rssh. I know that it and it works, but the user can access the whole system. Not only his home directory.
 

peterw

New Member
Well, thank you. But this is just another tutorial of how I can use rssh. I know that it and it works, but the user can access the whole system. Not only his home directory.
Read it again. At the end wlanboy wrote about a configuration of rssh with chroot:

Code:
user=test:011:000010:"/opt/scpspace/test chroot"  # scp with chroot
 

trexos

New Member
Read it again. At the end wlanboy wrote about a configuration of rssh with chroot:


user=test:011:000010:"/opt/scpspace/test chroot" # scp with chroot
Yes, I know. But I think I have to build a chroot environment for that as well. But I will test it :)


Edit: I don't understand how this works :( Is this the correct line:

Code:
user=test:011:000010:"/home/test"
 
Last edited by a moderator:
Top
amuck-landowner