I have an user created in VagrantFile and whenever I run a command with sudo it asks for a password. I don't know what that password is, so I would appreciate some help on this matter
I have tried to set up the following without success:
config.ssh.username = "Sorin"
config.ssh.password = "6282"
config.ssh.insert_key = false
User created as following in Vagrantfile:
bootstrap = <<SCRIPT
useradd -m Sorin --groups sudo
su -c "printf 'cd /home/Sorin\nsudo su Sorin' >> .bash_profile" -s /bin/sh vagrant
SCRIPT`
config.vm.box = "centos/7"
config.vm.hostname = "centos7"
VAGRANT_COMMAND = ARGV[0]
if VAGRANT_COMMAND == "ssh"
config.ssh.username = "Sorin"
end
config.vm.provision "shell", inline: "#{bootstrap}", privileged: true
end
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: