How To Change Vagrant Default Name

4,066 views
Skip to first unread message

Sargon

unread,
Jun 28, 2016, 6:09:33 PM6/28/16
to Vagrant

New to Vagrant, sorry.

I want to use a different user name than ''vagrant" as easily as the default. 

I am adding the line

    ...
    config.ssh.username = "newnamel"

end

And is seems to take it but then authentication fails.  What else does it need? 

Thanks


Alvaro Miranda Aguilera

unread,
Jun 29, 2016, 3:16:05 PM6/29/16
to vagra...@googlegroups.com
the user uses there must exist on the box and have the vagrant ssh public key

one way to do that is you could start a box, copy the home of the vagrant as your user, set proper permissions, create the new user, and package the box.

Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/c74a8ed3-7da5-4388-8ff4-49291b78a610%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sargon

unread,
Jun 29, 2016, 5:07:03 PM6/29/16
to Vagrant
Thank you for your reply.  I am the OP. 

So really there is no way to just change the string "vagrant" to another for the default user name, without complications like keeping the vagrant user and creating a second one.  

It seems it would be so easy to do this in software, but it is not in Vagrant.  Perhaps by design?  Who knows.

Thanks again.

Alvaro Miranda Aguilera

unread,
Jun 30, 2016, 3:19:24 PM6/30/16
to vagra...@googlegroups.com
hello

thats the user that vagrant the tool uses to login ssh into the guest box

so the user and authentication need to be in place

make sense? by default vagrant tries vagrant, but you can override to any other user, but the user need to exist, otherwise, is like having someone sshing into a linux box with a non existing user.

Alvaro


Reply all
Reply to author
Forward
0 new messages