Home > linux > On a linux server how do you use multiple terminals over a single ssh connection?

On a linux server how do you use multiple terminals over a single ssh connection?

May 1Hits:2

I often find myself opening several ssh connections in order to view several log files at a time with tail -f.

This isn't a problem when I'm at home because I use public key encryption for password-less login. However, I will often use computer at my university to do this so I don't have the option of using my private key. It gets annoying to enter my password 4 or 5 times to get several terminal windows.

How can I get multiple terminals over a single connection?


Just use GNU screen, it's great as you can start up remote sessions and restore them if your connection drops. It's available as a package for most distributions and may even already be installed on your university system.

The manual will give you all you need to get started, by default all commands are preceeded by Ctrl+A. For example to bring up the onscreen help, just press Ctrl+A then press ?

screen allows you to have multiple terminals and more (such as the ability to detach and re-attach to your session).

Some notes to get you going:

Ctrl-a c   create
Ctrl-a d   detach
screen -r  reattach
Ctrl-a a   toggle
Ctrl-a "   list

And some recommended reading:

Take a look at the following two articles on SSH connection sharing:


Basically, do a google search on ssh connection sharing and you'll find a bunch of other articles on it.

Possibly, you could use X forwarding to open multiple remote xterms on your local desktop.

You give no compelling reason why you can't use private keys from the other systems. Generate them per-machine and add the applicable keys to authorized_hosts

Still, use screen.

You may also want to look at byobu. It's an enhanced version of Screen and I believe it's a Ubuntu project. But it comes standard with Ubuntu 9.10 and newer.

I tend to still use Screen though by habit but wanted to mention this newer alternative.

If all you're using it for is tailing several files, you may also be interested in multitail.

One unmentioned screen feature is to "detach" screen and it will keep running whatever commands you have running in that set of screens. Once screen is detached, you can logout and it all keeps chugging away even after logging off. I'll startup screen and then do several c commands to create new 'subscreens'. I can switch between them and start some long running compile or data processing and be assured that my crappy VPN connection won' cause everything to die with it.

After logging off, you can log back in and use 'screen -R' which will re-attach you to your existing screen sessoins.

Tags:linux, ssh

Related Articles

  • On a linux server how do you use multiple terminals over a single ssh connection?May 1

    I often find myself opening several ssh connections in order to view several log files at a time with tail -f. This isn't a problem when I'm at home because I use public key encryption for password-less login. However, I will often use computer at my

  • If I change the root password on a linux server, can someone still access root if they created an SSH authorized_key for root user?July 1

    I'm not even sure if I asked that right. Anytime someone mentions changing the root password, they mention changing /etc/passwd, or just using the passwd command, but I've never heard of having to change it in an authorized_keys file as well. Where m

  • SQL Server logins and users - assign multiple logins to a single user? November 28

    This question already has an answer here: Mapping of multiple server logins to one database user 1 answer In SSMS, since I can't assign multiple login objects to a single user object, what is a best practice to achieve an equivalent security model? F

  • How to get a Windows Server to tell a LINUX server to Run a Script?June 17

    How can I get a Windows server to tell a LINUX server to run a script? --------------Solutions------------- Using SSH. You can specify a command to run on the command-line, and you can set up SSH keys so that you don't need to enter a password every

  • Ssh: Windows host tunnel through a middle linux server to another linux host with limited portsApril 27

    Addendum: I've seen question "Windows HTTP tunnel through 2 Linux hosts?" and trying to learn something about the answers. I learned. I will start giving my problem, and then talking a little about my tests with answers of that question. I'm try

  • How do I set up passwordless RSA/DSA ssh connections under a linux serverFebruary 24

    I've set up an linux server (32 bit), and would like to be able to ssh in as root based on RSA or DSA key trust. I've appended both public keys to ~/.ssh/authorized_keys and restarted the service; I am still prompted for a password. How do I enable k

  • How do I SSH into a Linux server from a Linux bastion host?March 25

    The scenario is like this: Windows workstation -> Linux bastion host -> Linux server From my Windows workstation I use PuTTY to SSH into the Linux bastion host from which I then SSH into the Linux server. Question is, how do I do that when the authe

  • Linux server not routing my packets

    Linux server not routing my packetsMay 21

    I have a linux server (Ubuntu 12) with 2 NIC's. eth0 is connected WAN (inet mask eth1 is connected LAN (inet mask I want my windows machine to connect to the internet. Win -> eth1 -> eth0 -> int

  • Connect from Windows 8 from home network to office Linux serverSeptember 24

    My client's office has a Linux server. Whilst I am in the client's office, I am able to connect to their Linux server from my Windows 8 laptop using PuTTY with their wifi connection. I wonder is it possible when I am working from home, would I be abl

  • Giving remote access to files for only a single directory on a Linux serverMay 11

    I need to give a user named "Bert" access to one directory (/var/www/application/thisDirectory/) on my Linux server. Initially, I tried to use FTP (actually SSH). My first thought was to chroot Bert and make his home /var/www/application/thisDir

  • Telnet on Linux ServerMay 29

    I want to know if it is necessary to have telnet enabled on both sides of machines to get telnet connection. Here's the issue: I am trying to telnet some public IP on port 80 from a Linux web server (Red Hat). This public IP has got HTTP (80) enabled

  • How to backup large directory from linux server to windows machineJuly 4

    Up until now ive been using FTP to connect to the server and copy the files to my local machine but the directory has grown 3gb in the past few weeks and it usually takes 40mins to copy 100mb so FTP is no longer an option for this. What is the quicke

  • Secure Your Linux ServerJune 17

    The Linux Operating System is one of the most stable and diverse OS's around. It's also one of the most popular servers in the world, thanks to its stability, process handling and developer dedication. No matter what you're planning to do with Linux,

  • Tune Your Linux ServerApril 4

    Tuning your Linux server can mean many things to many people. A portion of tuning is about security, insuring the configurations of the ftp, mail, ssh and web servers are properly setup to enable access and interaction with your server while tighteni

  • Review: Linux Server SecurityFebruary 22

    Staying on my current security theme, O'Reilly has published a second edition of Linux Server Security by Michael D. Bauer. The book, targeted toward those managing Internet-connected systems, also known as bastion hosts, packs a powerful arsenal of

  • Fire Up your own Linux Server

    Fire Up your own Linux ServerJanuary 11

    Installing a Linux distribution can be both exhilarating and frustrating. My first two attempts at Linux installs – the first in 1996, the second in 1997 – were unsuccessful. Installation routines and hardware support in Linux at the time were much l

  • How many and which partitions should I create for a linux server?April 30

    Partitions are very important on Linux server because it give you a lot of flexibility, for example when upgrading to a bigger hard drive. But, how many partitions should I create when building a Linux box ? Which size should I set for each partition

  • How do I know if my Linux server has been hacked?May 1

    What are the tell-tale signs that a Linux server has been hacked? Are there any tools that can generate and email an audit report on a scheduled basis? --------------Solutions------------- Keep a pristine copy of critical system files (such as ls, ps

  • How to identify I/O bottlenecks on a Linux server?May 2

    How do you determine that the performance of your Linux server is I/O bound and, perhaps more importantly, what process or processes are casuing the problem? --------------Solutions------------- I wrote a comprehensive guide to tracking down performa

  • Backup Linux server onto windows server or DPM server/owner and rights in NTFS?May 10

    We are using a rsync based backup for our Lonux servers which is fantastic. We rsync all our Linux server onto our large Linux base samba fileserver. Unfortunately that server is completely outdated and migrated over to Active Directory. Now I'm stuc

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.732 s.