Skip to content

Instantly share code, notes, and snippets.

@ml-eds
Last active July 26, 2019 14:10
Show Gist options
  • Save ml-eds/70af5c04df0b4cb4b1972c6b2b5b4961 to your computer and use it in GitHub Desktop.
Save ml-eds/70af5c04df0b4cb4b1972c6b2b5b4961 to your computer and use it in GitHub Desktop.
SSH connect to Vagrant VM without "vagrant ssh"

get current ssh config of vagrant vm

vagrant ssh-config

Host default
  HostName 127.0.0.1
  User ubuntu
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /Users/gonzo/VM/ubuntu1604/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL

normal ssh client equivalent to 'vagrant ssh'

ssh [email protected] -p 2222 -i ~/VM/ubuntu1604/.vagrant/machines/default/virtualbox/private_key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment