I usually have the habit of working with different terminal pointing to the same directory by opening different files. I sshed an server from one of my terminal from ubuntu and I had to do the same for all my terminals, is there a way where I can duplicate the terminals so that I don't need to connect on every terminal? Thanks, sorry if this is a duplicate, seems like an very common question.
You can use Linux Screen to do what you need. It's a good tool to work with :)
tmux on the server.
byobu is recommended since it is a wrapper script around
These are "command-line window managers" - with one SSH session you can open a lot of "windows", each window containing a shell, you can switch between them and all the software you are running still running even if you disconnect.
Try this on server:
sudo apt-get install byobu
<F2> to create more one window and
<F4> to navigate between windows. Press
<Ctrl> + a + d to deattach your session (all your windows will keep running) - if byobu asks something to you, answer that you want to use screen-like keyboard shortcuts. Then, if you disconnect, reconnect and execute
byobu again, you'll be in your last session, with all that windows.
Obviously, you can also use
byobu locally and open only one terminal window (instead of tabs in your terminal application, like
gnome-terminal, you'll have windows inside
You can clone your SSH session using the ControlMaster option in OpenSSH 4.0 (older versions does not support it). Check out this straight-forward tutorial.
Tmux/screen is fine, but it's kind of uncomfortable to have multiple terminals in a window manager in a terminal in a window manager, the inner window manager being tmux/screen.
What I do for this is having keybindings that launch terminals that ssh to the systems I most commonly connect to. So, for example, pressing Super+F5 would execute
urxvt -e ssh common-server-1.
Because I got keys set up for these systems, I only need to input my key decryption password for the first terminal, and it stays cached long enough to launch other terminals that immediately go to the remote system's shell prompt.
To quickly get them all on the same directory, I make use of shell history. The directory I want is typically the last one I went to, so I just
cd Ctrl+pEnter and I'm there.