Chinaunix首页 | 论坛 | 博客
  • 博客访问: 259406
  • 博文数量: 74
  • 博客积分: 1470
  • 博客等级: 上尉
  • 技术积分: 793
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-25 21:01
文章分类

全部博文(74)

文章存档

2011年(1)

2010年(32)

2009年(32)

2008年(9)

我的朋友

分类: LINUX

2009-10-07 15:58:08

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.
When you type ~ you will not see that immediately on the screen until you press and press enter. So, on the remotehost in a new line enter the following key strokes for the below to work: ~

remotehost$ ~^Z
[1]+ Stopped ssh -l jsmith remotehost
localhost$


  • 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
[1]+ Stopped ssh -l jsmith remotehost


  • 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$


reference: <>




阅读(1295) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~