Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
TetraWiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Linux 101 hacks
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=='''Hack 15. Toggle SSH Session using SSH Escape Character'''== When you’ve logged on to the remotehost using ssh from the localhost, you may want to come back to the localhost to perform some activity and go back to remote host again. In this case, you don’t need to disconnect the ssh session to the remote host. Instead, follow the steps below. # Login to remotehost from localhost: localhost$ ssh -l jsmith remotehost # Now you are connected to the remotehost: remotehost$ # To come back to the localhost temporarily, type the escape character ~ and Control-Z. <nowiki>When you type ~ you will not see that immediately on the screen until you press <Control-Z> and press enter. So, on the remotehost in a new line enter the following key strokes for the below to work: ~<Control-Z></nowiki> remotehost$ '''~^Z''' <nowiki>[1]+ </nowiki>Stopped ssh -l jsmith remotehost localhost$ 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: localhost$ '''jobs''' <nowiki>[1]+ </nowiki>Stopped ssh -l jsmith remotehost 5. You can go back to the remote host ssh without entering the password again by bringing the background ssh remotehost session job to foreground on the localhost. localhost$ '''fg %1''' ssh -l jsmith remotehost remotehost$
Summary:
Please note that all contributions to TetraWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TetraWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)