Restricting Shell Users to their Home Directory

The “easiest way” to lock down users to their home directory is to switch their shell account to rbash (restricted bash).  The rbash shell behaves like the bash shell, but some functions are disallowed e.g. change directory with cd.

For more information refer to the man pages for rbash.

$ man rbash

To change the user’s shell modify the file /etc/passwd

$ nano /etc/passwd

and replace /bin/bash with /bin/rbash e.g.

guest:x:100:100::/home/guest:/bin/rbash

Related posts:

  1. Restricting Shell for only SCP/SFTP
  2. Samba on Ubuntu Quickstart Guide
  3. Apache HTTP Authentication
  4. Building a Server at Home
  5. Tomcat 5.5 for Ubuntu Quickstart Guide
This entry was posted in Security, Ubuntu and tagged , . Bookmark the permalink.

Comments are closed.