Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


SFTP without bash access
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.

SFTP without bash access

trexostrexos Member
edited February 2014 in General

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.. :p

  • @itgods said:
    batch access.. :p

    whoops. fixed :D

  • @trexos said:
    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 :)

    You can check out shells rssh or scponly. Both shells will provide SFTP access as normal but no shell access.

  • @Virtovo said:
    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?

  • @trexos said:

    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)

    Thanked by 1Chumbi
  • trexostrexos Member
    edited February 2014

    @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?

  • @trexos said:
    pls delete this post

    Is this all working for you now?

  • trexostrexos Member
    edited February 2014

    @Virtovo said:
    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

Sign In or Register to comment.