Skip to content

Instantly share code, notes, and snippets.

@ahupowerdns
Last active August 29, 2015 14:14
Show Gist options
  • Save ahupowerdns/127e69cef3109bf63333 to your computer and use it in GitHub Desktop.
Save ahupowerdns/127e69cef3109bf63333 to your computer and use it in GitHub Desktop.

Get your own restricted shell!

$ grep restricted /etc/passwd
restricted:x:1001:1001:bert hubert,,,:/home/restricted:/home/ahu/git/secfilter/shwrap

$ cat shwrap
#!/bin/sh
/home/ahu/git/secfilter/secfilt --no-outbound-network=1 /bin/bash

Let's connect to it:

$ ssh [email protected]
[email protected]'s password: 
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-39-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

restricted@brul:~$ ssh ds9a.nl
ssh: Could not resolve hostname ds9a.nl: Name or service not known

restricted@brul:~$ exit
Connection to 127.0.0.1 closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment