Implementation method of switching SSH session with SSH exit under Linux _linux

Source: Internet
Author: User

This technique is very practical. In particular, remote login to a host a, and then from a landing to B, if you want to do some operation on a, you have to open a final
End, very troublesome.

When you use SSH to log on to a remote host from this computer, you may want to switch to local operations and then back to the remote host. This time, do not need the middle
To disconnect the SSH connection, simply follow the steps below:

1. Login to remote host:

localhost$ SSH 172.16.1.165
oracle@172.16.1.165 ' s Password:
Last Login:fri Mar 14:48:08 from Euos

2. Connected Remote host:

remotehost$

3. To temporarily return to the local host, enter the exit symbol: "~" and "control-z" combination.

When the input "~" is not immediately visible on the screen, it is displayed together when you press and press ENTER.
as follows, enter "~" in the remote host.
remotehost$ ~^z [suspend SSH]
[1]+ Stopped ssh 172.16.1.165
localhost$

4. It has now been returned to the local host, and the SSH remote client session is running in the UNIX background and can be viewed as follows:

localhost$ Jobs
[1]+ Stopped ssh 172.16.1.165

5. You can switch the SSH session process running in the background to the foreground and back to the remote host without entering a password

localhost$ FG%1
SSH 172.16.1.165
remotehost$

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.