How to do a shared SSH session. Part I
Have you ever wanted to do a secure shell session, or wondered what one is? Have you been using secure shell logins, but would like to be able to share the session in real time with the person sitting in front of the terminal on the other end? If you answered yes to any of the questions above, then this guide is for you. While this guide will be Ubuntu-centric, with slight adjustments it will work on any Linux distribution.
Your IP Address (whats my ip)
Be sure to have this for later, you may have a dynamic address, if so just check back here to find out your updated address.
Setting up SSH
On a typical Ubuntu Linux install both machines will require an additional package to be installed in order to operate as an ssh server.
Install SSH
Open a terminal:

Paste the following code into a terminal.
sudo apt-get install ssh
How to start an SSH session.
You now have everything installed to recieve or initiate an ssh session in Ubuntu Linux; now its time to try it out. A basic SSH session is pretty easy and straight forward. If the computer wish to connect to is on your local area network, then it is best to just connect to it using its local IP address. You can find the local ip address of a computer using the terminal, or through the gui. If the computer you wish to connect to is not on your local area network, then have the operator of that computer communicate his ip address to you; for your convenience I have included an IP script at the top of this page that will tell you your IP address as assigned by your internet service provider.
Finding your local IP using the terminal
ifconfig eth0 | grep 'inet addr:'
Finding your local IP using the GUI
Right click on Network Manager Applet; then Left click on Connection Information from the drop down dialogue box. Your I.P. address will be at the top of the list.

Start the SSH session
Open a terminal as outlined above, and then using the username that you would like to log in with(must exist on the computer your logging into), and the IP address that you collected (instead of mine), paste the following code:
ssh username@127.0.0.1I will be using 127.0.0.1 or "home" as our generic IP address, and "username" as our default account, you should use accounts and IP's specific to your machines.
After you press Enter you will be asked to accept the machines signature.
Then you will be given a request for a password to the account
your logging into.
You should now be successfully logged into username's account.
From here you can run any bash commands you require on the remote machine. Remember that on the terminal that you are secure shelled into a remote machine, any commands run in that terminal will be executed on the remote machine.
When you are finished simply enter:
exitin the terminal, and the session will exit.
Take me back to the beginning.
How to do a shared SSH session. Part II
For this section of the step by step guide to a shared ssh session we will be using screen. The screen application is available by default in Ubuntu Linux; if you are using some other distribution you will need to verify that you have screen installed, and if not, install it.
While it is possible for screen to be initiated by either computer in the ssh session, we will assume that the person/computer that initiated the ssh session will also initiate the screen session; the tutorial works the same way regardless of who initiates though.
Starting up screen with an active SSH session.
Computer A; in an ssh terminal already logged into the remote machine please type:
screen -S meaningful_name_here
then press the Enter key.
You will now be given this screen:
Press either the Spacebar or the Enter key to continue.
You will now be in a blank terminal screen with bash prompt showing username and machine name of the remote computer, like this one:

Now we need to connect the remote computer to the new screen session.
Computer B; in a terminal please type:
screen -ls
You will get a ist of screens availabe:
Usually only one screen will be listed, but in the case you see more than one, you will be choosing the one that has the meaningful name assigned by Computer A's operator. So using the example from this screen shot, in a terminal you would type the following:
screen -x 13126.Rob
Where the number 13126 is a random pid assigned to the screen, and Rob is the meaningful name given to the screen by Computer A's operator.
You will then be sharing a terminal screen with Computer A, and anything typed by either Computer A, or Computer B will be seen on the screens of both computers.
To end a screen session simply type in the shared screen:
exit
Since the command is sent to both computers, screen will exit on both computers; then to end the ssh session, Computer A (the computer that initiated the ssh session) simply types:
exit
once more, and the ssh session will end and disconnect the two computers.
Somewhere down the line I may do a follow up on this little series that will show different authentication methods, permission settings, and other ways to use ssh and screen. For now you can learn a lot about these powerful tools by reading the man pages:
man ssh
man screen
Take me back to the beginning of Part I
Take me back to the beginning of Part II
Enjoy!