When working in a Linux/unix environment, the most common way to log on to a remote host is to use SSH for remote logins, but sometimes we need to switch between two or more host terminals frequently, so it is cumbersome to provide a password each time. In fact, you can not completely from the SSH exit, directly suspend the current job can be, the specific way is to type the symbol "~", and then the shortcut key Ctrl + Z, so you can suspend the SSH already logged in, if you want to return, you can directly FG or FG followed by the specific job number Examples are as follows:
knightrcom@local-server:~$ hostname
Local-server
Knightrcom@local-server: ~$ ssh knightrcom@ "test2.csdn.com"
KNIGHTRCOM@test2.csdn.com ' s Password:
Last Login:thu June 06:31:11 from 9.123.72.20
Dis Beez My box.
It don ' is real fast.
But If you are mess with it,
I be Kickin ' Yo butt!
--Management
[Knightrcom@test ~]$ hostname
Test
[Knightrcom@test ~]$ ~^z [suspend SSH]
[1]+ Stopped ssh knightrcom@ "test2.csdn.com"
knightrcom@local-server:~$ hostname
Local-server
knightrcom@local-server:~$ Jobs
[1]+ Stopped ssh knightrcom@ "test2.csdn.com"
knightrcom@local-server:~$ FG
SSH knightrcom@ "test2.csdn.com"
[Knightrcom@test ~]$ echo "Game over:)"
The
Yellow section is the most critical, the first is to suspend the current job, and the other is to restore the current job:)