SSH remote session management tool

Source: Internet
Author: User
Tags vps ssh server

SSH remote session management tool

What I was most afraid of when I first came into contact with Linux is that the network suddenly disconnects when I remotely log on to Linux through SSH to compile and install Linux VPS programs (such as installing lnmp, in other cases, the connection to the remote SSH server has to be disconnected, and commands executed remotely have to be stopped. You can only reconnect and run the commands again. I believe that some vpsers have encountered this problem. Today we will introduce VPSer to a remote session management tool-screen command.

I. What is the screen command?

Screen is a full-Screen window manager that allows multiple processes to reuse one physical terminal. Screen has the concept of session. You can create multiple screen Windows in one screen session, just like operating a real telnet/SSH connection window in each screen window.

Ii. How to install the screen command?

The screen command is installed in most of the other streamlined systems or custom systems. If the screen command is not installed, the CentOS system can execute:Yum install screen;

Run Debian/Ubuntu:Apt-get install screen.

3. How to Use the screen command? 1. Common usage

It is used to solve the problems we encountered at the beginning of the article, such as when installing lnmp.

1.1 create a screen session

Run the following command first:Screen-S lnmpScreen creates a session named lnmp. VPS detective https://www.vpser.net/

1.2 temporarily leave to keep the tasks or programs in the screen session

When you need to temporarily exit (the program in the session will not be closed and is still running), you can press the shortcut key Ctrl + a d (that is, press Ctrl, and then press a, d)

1.3 restore screen sessions

When you return, you can execute the following code:Screen-r lnmpYou can recover to the lnmp session created before leaving. If you forget or do not specify the session name, run the following command:Screen-lsScreen will list the existing sessions, such:

11791. lnmp is the lnmp session created by screen. The lnmp session has been temporarily exited, so the status is Detached. When screen-r lnmp is used, the status changes to Attached, 11791 is the process ID of the screen session. It can also be used to restore the session:Screen-r 11791

1.4 disable screen sessions

Run:Exit[Screen is terminating] indicates that the screen session has been successfully exited. VPS detective https://www.vpser.net/

2. Remote demonstration

First, the presenter runs the command on the server.Screen-S testCreate a screen session. The audience can link to the remote server for execution.Screen-x testThe audience screen will be synchronized with the presenter.

3. Common shortcut keys

Ctrl + a c: create a window in the current screen session
Ctrl + a w: Window list
Ctrl + a n: Next window
Ctrl + a p: previous window
Ctrl + a 0-9: switch between 0th windows and 9th windows

If you have anything because you can leave a message below this article or post to the https://bbs.vpser.net.

> Reprinted please indicate the source: VPS detective link address: https://www.vpser.net/manage/screen.html

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.