How to jail linux user

12,682

Solution 1

A Google search on "openssh jail" led me to SSHjail for openSSH. If your client uses ssh/scp to access the said servers, this might be what you are looking for.

Solution 2

The "best answer" from 2009 is outdated. OpenSSH now comes with the ChrootDirectory option. See http://www.debian-administration.org/articles/590 which is for an already-old version of ssh.

Solution 3

It is important to note that chroot(2) is not meant for security purposes. It is incredibly easy to escape a chroot jail. See this article on abusing chroot for more information.

Solution 4

If you really want to go to that extreme, SE Linux (or any other mandatory access control) is a definite improvement of the default unix permissions.

Solution 5

An effective way to do this is to use lshell

Share:
12,682
Andrei Serdeliuc ॐ
Author by

Andrei Serdeliuc ॐ

Updated on June 08, 2022

Comments

  • Andrei Serdeliuc ॐ
    Andrei Serdeliuc ॐ about 2 years

    Is there something similar to chroot, but for users?

    We are about to grant access to our servers for a client and would like them to see only the directories we allow.