Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: SSH question - SSH'ing into an already open terminal on host

  1. #11
    Join Date
    Jul 2011
    Location
    South-Africa
    Beans
    678
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: SSH question - SSH'ing into an already open terminal on host

    In short, yes it can be done. Read the screen manpage to see hos to configure IT to behave as you want IT.

    Ps. Google 'byobu', as this is ubuntu implementation of screen.
    Oka, Im lost.

    I read the man page and found:

    C-a M (monitor) Toggles monitoring of the current window.
    and when I do it, it gives me a notice that monitor mode is enabled, but the client still cant connect?

    I googled that byobu but cant make head or tale, when i run byobu in the terminal, (detached) it attaches me to the fisrt availible screen it seems, but non of the byobu bindings work (the F keys).

    But screen seems to work fine, so i dont want to mess with yet another application over this one.. all i wish is to be able to view the terminal on the server while being SSH'ed into the same terminal from another computer... haha.. Ouch, my brain is starting to hurt..

  2. #12
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: SSH question - SSH'ing into an already open terminal on host

    byobu is just "screen" with some extra stuff.

    I've had problems with it so I just use screen.

    I think the "monitor" option for screen is used to listen for output / null output and send a bell if it sees it.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #13
    Join Date
    Jul 2011
    Location
    South-Africa
    Beans
    678
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: SSH question - SSH'ing into an already open terminal on host

    Hay all,

    Thanks for the input.

    I will just detach from the running terminal. Being able to view activity in the script is not a huge issue. As this will only be used by two people (myself and one other person), I don't see the need to go to great lengths to get this working.

    Thanks for all your insets. greatly appreciate it

  4. #14
    Join Date
    Feb 2008
    Location
    Pelican Bay Correctional
    Beans
    Hidden!

    Lightbulb Re: SSH question - SSH'ing into an already open terminal on host

    I know it says solved, but here's what I have done for the same task-based solution:

    Launch gnome-terminal locally and then type screen and connect to Server1. Detach from Server1 (Ctrl+A+D)
    Type screen -ls and note the screen session identifier.

    type screen again and connect to Server2. Detach from Server2. Detach from Server2 (Ctrl+A+D)
    Type screen -ls and note the screen session identifier.
    Screen for Server1 in this example is 5128
    (actual here is "28504.pts-1.My-Kungfu (Detached)" 28504 is what you are looking for.
    Screen for Server2 in this example is 5150

    Make an qscreens.sh file in your $PATH somewhere and add these 2 commands:

    Code:
    #!/bin/bash
    gnome-terminal --tab-with-profile=default --title=Server1 -e "screen -x 5128" --tab-with-profile=default --title=Server2 -e "screen -x 5150"
    Save the file and open terminal >
    Code:
    chmod 700 /path/to/qscreens.sh
    Now you can type qscreens.sh or Alt+F2 and run qscreens.sh and you are instantly (re)connected to Server1 in one tab and Server2 in another tab.

    NOTE: if you close the "new" gnome-terminal window with these 2 tabs open, just re-run qscreens.sh and you're back in business.

    Hope that helps.

    Enjoy.
    Last edited by Habitual; August 22nd, 2011 at 02:51 AM.
    I have 3 brain cells left, and two of them have restraining orders.
    Linux is just "DOS on 'steroids"

Page 2 of 2 FirstFirst 12

Tags for this Thread

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
  •