Spying on the console.

Some software prints error messages to the console that may not necessarily show up on your SSH session. Using the vcs devices can let you examine these. From within an SSH session, run the following command on a remote server:

# cat /dev/vcs1

This will show you what is on the first console. You can also look at the other virtual terminals using 2, 3, etc. If a user is typing on the remote system, you’ll be able to see what he typed.

SSH backdoor.

SSH from hades to earth.server.com with the -R flag. I’ll assume that you’re the root user on hades and that tech will need the root user ID to help you with the system. With the -R flag, you’ll forward instructions of port 2222 on earth.server.com to port 22 on hades. This is how you set up an SSH tunnel. Note that only SSH traffic can come into hades: You’re not putting hades out on the Internet naked.

You can do this with the following syntax:

# ssh -R 2222:localhost:22 username@hades.server.com

Once you are into hades.server.com, you just need to stay logged in and enter a command like:

username@hades.server.com:~$ while [ 1 ]; do date; sleep 300; done

to keep the machine busy and minimize the window.
Now instruct your friends to SSH as “username” into earth.server.com without using any special SSH flags. You’ll have to give them your password:

root@hades:~# ssh username@earth.server.com .

BTW no need

Once user is on the hades.server.com, they can SSH to earth using the following command:

username@hades.server.com:~$: ssh -p 2222 root@localhost

Short form:

from earth: ssh -R 2222:localhost:22 username@hades.somedomain.com
then: while [ 1 ]; do date; sleep 300; done
from hades: ssh -p 2222 root@localhost
and we can log in into earth.somedomain.com :))