1

Today i did give acces to SSH to my friend,and i want hem only to shay in folders that he is owning.So that is his home folder.

So,how can i make sure that he will only have acces to that folder? I did try using rbash,but he cant cd to his own folders.Can someone help?

fhntv24
  • 133

2 Answers2

3

This is probably more complex than some people realize. The reason is that you need to allow access to some binaries, for the jailed users to be able to do anything. Otherwise the user will be unable even to move back and forth between his own directories, to list and edit his own files, and so on.

There is a truly minimal, and simple solution on AskUbuntu, here. It is elegant and effective, and takes advantage of apparmor's profiles.

If this is too minimal, you may try googling ssh chroot jail. You will discover very many different solutions. This site provides a script that will do most (not all) of the work for you.

MariusMatutiae
  • 48,517
  • 12
  • 86
  • 136
1

I know this question is old but this helped me.

chmod o-x /home/*

run the above command from sudo and it will limit a user to its own home dir.

scottydelta
  • 1,617