如何在终端退出 vagrant 的 SSH

mic*_*den 24 linux ssh bash vagrant

按照此存储库中的自述文件,我应该以安全的方式进入我创建的虚拟机,但是一旦我这样做了,我该如何退出?

以下是说明:

$ git clone git://github.com/honza/django-chef.git
$ cd django-chef
# add yourself to the "users" array in the Vagrantfile
$ sudo echo "127.0.0.1 example.example.com" >> /etc/hosts
$ vagrant up
$ fab vagrant:honza bootstrap  # replace with your name
$ vagrant ssh    # OK, cool
$ run            # I'm trapped! 
Run Code Online (Sandbox Code Playgroud)

小智 29

假设run命令保持在前台运行,您很可能以CTRL+C. 然后 shell(和 SSH)会话可以用exit或终止CTRL+D

  • 我在 Windows 10 中使用 Cmder,`exit` 和 `CTRL+D` 对我有用,但 `CTRL+C` 不起作用。 (2认同)