Дублируйте удаленный сеанс в терминале в Linux (Ubuntu)

2128
user15586

Как дублировать удаленный сеанс в терминале Linux (Ubuntu)? Например, если у меня открыт сеанс SSH, как я могу скопировать этот сеанс в терминале?

1

1 ответ на вопрос

1
cody.codes

First install screen using apt-get:

sudo apt-get install screen 

Now open your ssh connection, e.g. (in my case, using a private key .pem file):

ssh -i ./this/is/a/path.pem ubuntu@x.x.x.x 

Start a screen session:

screen 

Press Ctrl + a then c (where c is pressed after you let go of pressing Ctrl and a simultaneously [this will open a new window.])

Either retype the command used to initiate your SSH connection, or press and select the command used to initiate your SSH connection.

Voila! You've just duplicated a remote SSH session in the terminal!

To switch between windows use Ctrl + a then n (where n is pressed after you let go of pressing Ctrl and a simultaneously.)

For a more in-depth guide on how to use screen, visit nixCraft.