How to switch SSH sessions in Linux using SSH exit character

PHPz
Release: 2023-05-11 17:22:14
forward
1210 people have browsed it

1. Log in to the remote host:

localhost$ ssh 172.16.1.165
oracle@172.16.1.165's password:
last login: fri mar 26 14: 48:08 2010 from euos

2. Connected to the remote host:

remotehost$

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

When you enter "~" you will not see it immediately on the screen, it will only be displayed together when you press and press Enter. .
As follows, enter "~"
remotehost$ ~^z [suspend ssh]
[1] stopped ssh 172.16.1.165
localhost$

4. Now that you have returned to the local host, the ssh remote client session is running in the unix background. You can view it 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 return to the remote host without entering the password

localhost$ fg % 1
ssh 172.16.1.165
remotehost$

The above is the detailed content of How to switch SSH sessions in Linux using SSH exit character. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template