New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
SFTP without bash access
Hello,
I searched for a way how I can use SFTP but without bash access. I found this tutorial and it works great: http://blog.swiftbyte.com/linux/allowing-sftp-access-while-chrooting-the-user-and-denying-shell-access/
But the root user has to be the owner of the home directories so I want to know if there is a better way, so that the home directory is owned by the specific user.
Thank you
Comments
batch access..
whoops. fixed
You can check out shells rssh or scponly. Both shells will provide SFTP access as normal but no shell access.
Thanks. I'm.not that experienced with linux. Its possible to install this shell next to the normal one right?
Yes then change the shell of the user in question:
chsh -s USERNAME
ForceCommand internal-sftp and set the shell to /bin/false, that's the right way to do that. And under the user home directory create his private and http directories where he can write his own files. If your user needs to publish a website consider adding the user to www-data group, chown user:www-data, chmod 750 and g+s his http directory, and then properly set php (basedir, disable verbs etc)
@Virtovo Thank you very much
I will use rssh. I tried to jail my users to their home directories:
http://pastebin.com/VYMU85wG
But now I can't connect to sftp anymore. What did I wrong?
Is this all working for you now?
No
But I tried to post the config here again with the quote function and it didn't work as well. So I did it with pastebin :P