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$