In the following page will be explained the procedure to share a bash screen session in order to do remote peer programming. Example :
Person A : @work : Office Milan, behind a NAT
Person B : @home : in Paris, behind a NAT
Both of them, couldn't hold directly an ssh connection, so we need to choos a thirdy part server that both could reach :
Example :
Server it-ws-1 : that have a public ip reachable by both A and B
Now proceed as follow :
Supposing that Person A is the one in charge to hold the shared screen session, he will do on his computer :
ssh -l root -R 222:localhost:22 it-ws-1
After that, on the it-ws-1 , will appear a new socket, on localhost listening on the tcp port 222 :
tcp 0 0 0.0.0.0:222 0.0.0.0:* LISTEN 1032/sshd
Now also the person B will login on the server it-ws-1 and after that, will do :
ssh -p222 root@localhost
This ssh will take advantage of the tunnel previously established , to reach the computer of the person A.
Open a screen with the following command :
screen -S <name of the session you wanna open>
Once you go into the screen session:
<ctrl+A>
:multiuser on
That's all! The only thing that the other collegue/collegues have to do in order to partecipate to the shared screen session is to type :
screen -x