I have a new user in my vagrant box(trusty64) and I am trying to ssh into it. Instead of logging into vagrant
user after vagrant up
, I want to login to my username.
What I have done so far
ssh-keygen
ssh-copy-id -p 2222 -i [email protected]
and the part of the Vagrantfile looks like this
config.vm.box = "ubuntu/trusty64"
config.ssh.username = "shash"
config.ssh.forward_agent = true
config.ssh.private_key_path = "~/.ssh/authorized_keys"
I can use ssh -p '2222' '[email protected]'
to login directly but when I give vagrant up
I keep getting the following error
default: Warning: Connection timeout. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
Any help in sorting out this is really appreciated.Thanks!
A complete set-up guide would be really helpful
The vagrant file will access that users home directory when you specify '~'.
config.ssh.private_key_path = "/home/shash/.ssh/authorized_keys"
Give that a go!
Add it to the Vagrantfile:
Vagrant.configure("2") do |config|
config.ssh.private_key_path = "~/.ssh/id_rsa"
config.ssh.forward_agent = true
end
https://stackoverflow.com/a/23554973/3563993
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With