Is there a way to open a terminal window ( or tab ) with another instance of an open SSH session ?
EDIT: I have a terminal window with a remote ssh session into a server. I want to open a new tab connected to the same remote ssh session.
With File->New Tab I get another tab but I have to open another ssh session to the remote server.
Perhaps this could help:
screen
It is not installed by default on Ubuntu, but is provided in the repositories.
It is very useful:
ssh
to a remote host and typescreen
to enter ascreen
session.Start whatever time consuming task you like, and then press Ctrl+A followed by Ctrl+C to create a new window in the screen session.
This will spawn a new shell where you can do what you want. Create even more windows using the same command.
To switch between two windows quickly, use Ctrl+A followed by Ctrl+A again. As you can see, Ctrl+A puts screen in command mode.
Ctrl+A Ctrl+D will detach from the screen session. You can then disconnect from the host and log in again later and use
screen -dr
to resume your session.To go to a specific
screen
window, type Ctrl+A followed by a number.Screen will exit when all active windows are closed (or the shells within have exited).
I got this from SSH and SFTP sessions.
Edit-
tmux is an alternative to screen. http://www.sitepoint.com/tmux-a-simple-start/
Connect to your remote server with:
Now run:
A terminal will appear on your local computer. From this terminal, you can run as many tabs or terminal windows as desired. They will all use the same
ssh
connection and be connected to the remote machine.most probably you might use OpenSSH control master multiplexing described with examples here : https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Multiplexing
I've done this before: Launch gnome-terminal on the server. ctrl+Z then bg from your original terminal window.
I normally use ssh -X -C, so you might have to do that, but I'm not sure. Also, it'll use your server's settings instead of the ones on your machine, which is sometimes inconvenient.
Yeah, in the terminal (menu) click on File -> New Tab
to open new tab in terminal
or are you asking for something else?