How to ssh to vagrant without actually running “vagrant ssh”?

后端 未结 16 1558
清酒与你
清酒与你 2020-11-29 15:07

I would like to reproduce the way Vagrant logs in to my VM within a shell script using an ssh command, so I create an alias to my Vagrant instance.

What

16条回答
  •  爱一瞬间的悲伤
    2020-11-29 15:39

    In terminal run

    vagrant ssh
    

    In another terminal window/tab run

    ps aux | grep ssh
    

    There you will see the actual command executed by Vagrant, something like this:

    ssh vagrant@127.0.0.1 -p 2222 -o Compression=yes -o DSAAuthentication=yes -o LogLevel=FATAL -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -i ~/.vagrant.d/less_insecure_private_key -o ForwardAgent=yes
    

提交回复
热议问题