1. Login to remotehost from localhost:
dipin@linuxgeek:~$ ssh user@remotehost
2. Now you will be connected to the remotehost and your prompt will read:
remotehost$
3. Now to come back to the localhost temporarily, type the escape character ~ followed by Control-Z.
You won’t see the ~ character on the screen immediately after you type it, until you press and press enter. So, on the remotehost enter the following key strokes: ~
remotehost$ ~^Z
[1]+ Stopped ssh user@remotehost
dipin@linuxgeek:~$
4. Now you are back to the localhost and the ssh remotehost client session runs as a typical UNIX background job, which you can check as shown below:
dipin@linuxgeek:~$ jobs
[1]+ Stopped ssh user@remotehost
5. Now you can go back to the remotehost ssh without entering the password again by bringing the background ssh remotehost session job to foreground on the localhost.
dipin@linuxgeek:~$ fg %1
ssh user@remotehost
remotehost$
Enjoy!.
Anonymous
W