使用 -c 或 --COMMAND 的 Vagrant ssh 会导致会话关闭 [英] Vagrant ssh using -c or --COMMAND causes the session to close

查看:31
本文介绍了使用 -c 或 --COMMAND 的 Vagrant ssh 会导致会话关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 vagrant 通过 ssh 执行命令的问题.会话在确认我的命令后终止.

I have an issue with vagrant executing commands over ssh. The session terminates after acknowledging my command.

例如如果我输入

vagrant ssh -c "echo hello"

hello 将出现在终端中,然后会话关闭.

hello will appear in the terminal and then the session closes.

除了 config.ssh.timeout 之外,还有什么我应该检查或更改的设置吗?

Other than config.ssh.timeout is there any other setting I should check or change?

推荐答案

这是预期的行为.就像在正常的 ssh 中一样,在命令退出后运行命令并关闭会话.这也是记录.

That's the expected behavior. Just like in normal ssh <command>, the command is run and session closed after the commend exits. This is also documented.

这篇关于使用 -c 或 --COMMAND 的 Vagrant ssh 会导致会话关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆