免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 3674 | 回复: 18
打印 上一主题 下一主题

shell结束,自动退出连接 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-03-26 10:25 |只看该作者 |倒序浏览
如题,新人请问如果做shell结束,自动退出连接?

论坛徽章:
0
2 [报告]
发表于 2009-03-26 10:26 |只看该作者

回复 #1 muma8708 的帖子

怎么退出连接?什么连接? exit?

论坛徽章:
0
3 [报告]
发表于 2009-03-26 10:29 |只看该作者

回复 #2 wtuter 的帖子

是啊,就是ssh登陆,执行shell,完了就自动退出

论坛徽章:
0
4 [报告]
发表于 2009-03-26 10:31 |只看该作者

回复 #3 muma8708 的帖子

ssh 远程执行命令执行完后会自动退出

论坛徽章:
0
5 [报告]
发表于 2009-03-26 10:39 |只看该作者
原帖由 muma8708 于 2009-3-26 10:29 发表
是啊,就是ssh登陆,执行shell,完了就自动退出



If you want to manually ssh to the remote host and the run a script on it, do the following to meet your requirements:

. ur_script

Note: make sure ur_script end with 'exit' command!!

论坛徽章:
0
6 [报告]
发表于 2009-03-26 12:51 |只看该作者
原帖由 nhw_cs 于 2009-3-26 10:39 发表



If you want to manually ssh to the remote host and the run a script on it, do the following to meet your requirements:

. ur_script

Note: make sure ur_script end with 'exit' command!!



Note: make sure ur_script end with 'exit' command??
有必要吗??

论坛徽章:
0
7 [报告]
发表于 2009-03-26 14:13 |只看该作者

回复 #4 wtuter 的帖子

我的shell是一个交互的,我主要是想让用户ssh登陆之后,直接运行这个ssh,完了退出连接,不能让用户进行shell以外的操作.不用远程执行.

论坛徽章:
0
8 [报告]
发表于 2009-03-26 14:16 |只看该作者
原帖由 merlin852 于 2009-3-26 12:51 发表



Note: make sure ur_script end with 'exit' command??
有必要吗??


我之所以强调这点就是有必要!! 没有写exit, 就不会logout .... 如果你有心, 就能据此推测一下shell 解释脚本的处理方式

论坛徽章:
0
9 [报告]
发表于 2009-03-26 14:17 |只看该作者
原帖由 muma8708 于 2009-3-26 14:13 发表
我的shell是一个交互的,我主要是想让用户ssh登陆之后,直接运行这个ssh,完了退出连接,不能让用户进行shell以外的操作.不用远程执行.


靠! 我不是告诉你怎么做了么? 看不懂英语??

论坛徽章:
0
10 [报告]
发表于 2009-03-26 14:25 |只看该作者

回复 #9 nhw_cs 的帖子

while  [  ]
do
done
exit

不起作用.我试过了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP