Difference between revisions of "Restricted Shell for SSH Server"

From wiki.linuxonlinehelp.eu
Jump to navigation Jump to search
(Created page with "If you use SSH Logins you can lock down the Console to a restriced shell with less enabled commands! * Login as root User on the Server * install rbash with: <pre> apt-get in...")
(No difference)

Revision as of 15:34, 23 May 2017

If you use SSH Logins you can lock down the Console to a restriced shell with less enabled commands!

  • Login as root User on the Server
  • install rbash with:
apt-get install rbash
  • rename bash by:
mv /bin/bash /bin/oldbash
chmod o= /bin/oldbash
  • create a symlink for rbash to bash
$ln -s /bin/bash /bin/rbash

3. enable rbash by system setting /etc/shells

$echo '/bin/rbash' >> /etc/shells

4. set user shell to /bin/rbash

$chsh   #set user shell to /bin/rbash

5. Disable "chsh" command for users

$chmod o= /bin/chsh

6. Login as user and test linux commands..