Intro

So, I needed to do some long jobs over ssh at work and managed to accidentaly stop it. After some whining, crying and general denial, I decided to read up on the screen command.

Among detaching long-running sessions to minimize problems should the ssh-session disconnect, I found one can use screen to share a ssh-session!

This article starts with how to share the ssh-session. Other tricks will be added later.

 

Sharing a ssh-session

  1. Start a terminal and connect to the remote server. Then become root.
    lanfear $ ssh sorin@cyndane2
    cyndane2 $ sudo -i
    cyndane2 # whoami
    root
    cyndane2 # 


  2. Start a screen session. The -S flag names this particular session.
    # screen -S shared


  3. Enable multiuser in this screen-session.
    Press control-a and (shift):. You should see a small :-prompt at the bottom of the screen. Type the following and press enter.
    #
    :multiuser on
    Multiuser is now enabled.

  4. Press control-a and (shift):. You should again see a small :-prompt at the bottom of the screen. Type the following and press enter.
    #
    :acladd root
    We've now shared the root user's session.

  5. Open a new terminal and connect to the same server. Become root and type this in the second terminal.
    # screen -x root/shared


    You should now see, live, whatever happens in the other terminal.
    Try switching terminals, and type in either. Anything that happens in the current active terminal is mirrored in the other.


  6. Terminate the sessions by pressing control-d as per usual.


 

 

 

 

 

 

 

 

 

 

 

Sources

https://askubuntu.com/questions/117487/using-ubuntus-screen-command-to-share-screens

 

 

 

 

 

 

 

Stop Spam Harvesters, Join Project Honey Pot

 

Get a free SSL certificate!

 

The leading nonprofit defending digital privacy, free speech, and innovation.

 

The Linux Foundation provides a neutral, trusted hub for developers and organizations to code, manage, and scale open technology projects and ecosystems.

 

Kubuntu is an operating system built by a worldwide community of developers, testers, supporters and translators.

 

 43ef5c89 CanonicalUbuntudarktext