Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: HOWTO: Connect to another user's console terminal using 'screen'

  1. #1
    Join Date
    Mar 2005
    Location
    Canada
    Beans
    1,595

    HOWTO: Connect to another user's console terminal using 'screen'

    Recently, I was helping another forum member setup and troubleshoot an SSH server and we were looking for an easy way to "share the terminal", so that he could see what I was typing & vice-versa. The problem was that he was on dial-up and using VNC was not a very feasible option.

    In the end, I just created a local account on my computer so that he could SSH into my computer and we used the 'write' command to pass messages back and forth between us. After we resolved the problem, I was still interested in finding out if there was an application that allowed users to "share" a terminal session (i.e. they could both interact with the same terminal session and see what the other was typing).

    After doing some searching, I found 'screen', which is labeled as a "Remote terminal viewer". Most of these steps are pulled verbatim from this article, however, I made some minor modifications for clarity and added a few steps for the new user.

    Case Scenario:

    Assume user jsmith wants to share his terminal session with remote user bjones for training or troubleshooting purposes, but does not want to use VNC or other full-blown GUI remote control access.

    Requirements:
    - GNU Screen
    - Local account on host computer for remote user (i.e. bjones requires local account)

    1. Install screen
    Code:
    sudo apt-get install screen
    2. Set the screen binary (/usr/bin/screen) setuid root. By default, screen is installed with the setuid bit turned off, as this is a potential security hole.
    Code:
    sudo chmod +s /usr/bin/screen
    Code:
    sudo chmod 755 /var/run/screen
    3. The host starts screen in a local xterm, using the command screen -S SessionName. The -S switch gives the session a name, which makes multiple screen sessions easier to manage.
    Code:
    screen -S screen-test
    4. The remote user (bjones) uses SSH to connect to the host computer (jsmith).
    Code:
    ssh bjones@jsmith.computer.ip.address
    5. The host (jsmith) then has to allow multiuser access in the screen session via the command CTRL-A :multiuser on (all 'screen' commands start with the screen escape sequence, CTRL-A).
    Code:
    CTRL-A
    :multiuser on
    6. Next, the host (jsmith) must grant permission to the remote user (bjones) to access the screen session using the commadn CTRL-A :acladd user_name where user_name is the remote user's login ID.
    Code:
    CTRL-A
    :acladd bjones
    7. The remote user can now connect to the hosts 'screen' session. The syntax to connect to another user's screen session is screen -x host_username/sessionname.
    Code:
    screen -x jsmith/screen-test
    Attached is a screenshot of 2 computers "sharing" the same terminal session.

    -Dave
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	screen-dapper.png 
Views:	4239 
Size:	476.7 KB 
ID:	19355   Click image for larger version. 

Name:	screen-edgy.png 
Views:	3211 
Size:	371.7 KB 
ID:	19356  

  2. #2
    Join Date
    Mar 2005
    Beans
    6,040

    Re: HOWTO: Connect to another user's console terminal using 'screen'

    This has potential to be very useful, thank you. It seems there's no end to the conveniences of screen.
    Previously known as 23meg

  3. #3
    Join Date
    Mar 2007
    Location
    in front of my computer
    Beans
    367
    Distro
    Ubuntu 6.06 Dapper

    Re: HOWTO: Connect to another user's console terminal using 'screen'

    wow cool i'm going to set up web/email server and if i can config it from my laptop that would cool!!!
    my computers
    1 laptop ubuntu 6.06 p3 512mb ram 120gb hd
    2 pc/server 2.4gh ubuntu server 7.10 512mb ram 80gb
    TRY MY RPG/virtual pets site Treeapets .com comeing soon :lolflag

  4. #4
    Join Date
    Nov 2007
    Beans
    27

    Re: HOWTO: Connect to another user's console terminal using 'screen'

    however the remote computer should open a ssh port on the firewall.
    Is it possible to do similar thing as reverse vnc ? or I called it reserve ssh such that remote side initiate a ssh call to the remote helpdesk.

  5. #5
    Join Date
    Mar 2005
    Location
    Canada
    Beans
    1,595

    Re: HOWTO: Connect to another user's console terminal using 'screen'

    Quote Originally Posted by adrianmak View Post
    however the remote computer should open a ssh port on the firewall.
    Is it possible to do similar thing as reverse vnc ? or I called it reserve ssh such that remote side initiate a ssh call to the remote helpdesk.
    Yes... see my signature below for "HOWTO: Reverse VNC".

    Be advised that it does not work with the latest version of Ubuntu (Gutsy 7.10).

    -Dave

  6. #6
    Join Date
    Mar 2005
    Location
    Canada
    Beans
    1,595

    Re: HOWTO: Connect to another user's console terminal using 'screen'

    Oops, sorry. I misread your question. I thought you wanted to "Reverse VNC" (rather than "Reverse SSH").

    Please ignore my post.

    -Dave

  7. #7
    Join Date
    Nov 2007
    Beans
    27

    Re: HOWTO: Connect to another user's console terminal using 'screen'

    If I just want to share console terminal, is it possible to do a reverse ssh ?

  8. #8
    Join Date
    Jul 2007
    Beans
    71

    Re: HOWTO: Connect to another user's console terminal using 'screen'

    how do you cleanly leave the user's screen? I did screen -d and that completely detached it.

    Thanks for the tips!

  9. #9
    Join Date
    Oct 2008
    Beans
    7

    Re: HOWTO: Connect to another user's console terminal using 'screen'

    when inside Screen - enter " Ctrl + A + D "
    that will leave the screen open until the screen is reentered and detached.


    another useful way of using the screen if the people who wish to talk are on the same user and machine.

    one needs to type " screen "
    and once it is open
    the other maye type " screen -x "

    that will enter the previous screen session if no other are already open.

    Weazel.

  10. #10
    RealG187 is offline Chocolate-Covered Ubuntu Beans
    Join Date
    Mar 2007
    Beans
    1,373

    Re: HOWTO: Connect to another user's console terminal using 'screen'


Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •