Vagrant sudo yum install whois (or anything else)

99 views
Skip to first unread message

Devils Kiddo

unread,
Apr 17, 2019, 7:18:38 AM4/17/19
to Vagrant
Heyo,

Got a little problem and I cannot seem to find a fix for it anywhere.

I am able to connect to SSH correctly using vagrant SSH to my user Sorin.

Whenever I run a command that requires root access it does not work. It demands a password  and I do not know what that password is:

Sorin@centos7 ~  $ sudo yum install whois

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for Sorin:

Any help would be appreciated. If you need anything let me know and I will provide.

Daniel Gil Jara

unread,
Apr 17, 2019, 12:57:15 PM4/17/19
to vagra...@googlegroups.com
Provide Vagrantfile in order we can understand how the Sorin user is created.

--
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/82cf5c76-c7b8-4399-aa16-6a06d9b9122e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Devils Kiddo

unread,
Apr 18, 2019, 1:53:50 PM4/18/19
to Vagrant
vagrant filie attached
Vagrantfile

Alvaro Miranda Aguilera

unread,
Apr 19, 2019, 4:45:08 PM4/19/19
to vagra...@googlegroups.com
hello
when you run sudo, it ask for the user password

the vagrant file seems to be creating a user, just not sure why you need that in that way.

whats the requirement that the user need to be sorin and not vagrant?

i would suggest to create a new box right to use, it helps in the long run

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/82cf5c76-c7b8-4399-aa16-6a06d9b9122e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Alvaro

Devils Kiddo

unread,
Apr 20, 2019, 2:12:10 AM4/20/19
to Vagrant
There is no requirement for the user to be Sorin. It is preference only.

Isn't there a workaround for this, or a place where I can find/set that password which I have no idea where it is set up?
To unsubscribe from this group and stop receiving emails from it, send an email to vagra...@googlegroups.com.


--
Alvaro

Alvaro Miranda Aguilera

unread,
Apr 20, 2019, 2:56:49 PM4/20/19
to vagra...@googlegroups.com
hello

your script is creating the user, without a pass

you can update the script to set a pass

or you can set the user to no need password for sudo

you can google about `sudoers` that is the file that manage this.

is more like a OS question rather than vagrant question

alvaro.

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/9635b33c-fb15-4ad8-8cb2-1a49630f5f71%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Alvaro

Devils Kiddo

unread,
Apr 21, 2019, 4:40:58 AM4/21/19
to Vagrant
Hello,

Have you any idea on how to set it up cause I really got none. I have tried in my code to add the following:

config.ssh.username = "Sorin"
config.ssh.password = "6282"
config.ssh.insert_key = false

But that didn't do the trick.


--
Alvaro

Devils Kiddo

unread,
Apr 23, 2019, 2:22:58 AM4/23/19
to Vagrant
Update, I was able to install whois. Somehow I connected to user vagrant instead of user sorin and vagrant does not require a password. But I would really appreciate if I could have a little help resetting the password for username sorin.

Thanks!

Devils Kiddo

unread,
Apr 24, 2019, 10:57:36 AM4/24/19
to Vagrant

I was able to do it myself by reconnecting to user Vagrant which doesn't require any password to run as root.

Then I ran the following commands to:

  1. # passwd Sorin to change the user password for Sorin:
  2. # Visudo to access and edit etc/sudoers: `## Allows people in group wheel to run all commands

    %wheel ALL=(ALL) ALL`

The ''#" did not exist on my end to remove it. Remove it if exists on your end on the second line in front of %wheel

  1. Save changes and return to editor.

4.# usermod -aG wheel Sorin to Add the user I created to the wheel group.

  1. # su USERNAME - to switch to the Sorin user account that I created.

  2. $ groups Sorin wheel

  3. sudo whoami to check if it was root, the first time it asked for password.

Reply all
Reply to author
Forward
0 new messages