« Back to Index

Manually SSH into Vagrant

View original Gist on GitHub

Vagrant SSH.md

Reference: http://thediscoblog.com/blog/2013/10/16/ssh-and-vagrant/

ssh -i $(vagrant ssh-config | grep IdentityFile  | awk '{print $2}') -l vagrant -p 2222 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 127.0.0.1

Note: vagrant can be changed for any other user
e.g. you can add a user when logged in as root (see following section)

vagrant ssh
su # password: vagrant
adduser foo
adduser bar
addgroup baz # create new group, which above users will be assigned to
mkdir /var/baz # folder to hold tmux session data
chgrp baz /var/baz # give group access to tmux session folder
chmod g+ws /var/baz # ensure new files are accessible to the group
usermod -aG baz foo # add foo user to the baz group
usermod -aG baz bar # add bar user to the baz group