Bug 1384679

Summary: Fedora Cloud Base Vagrant Boxes Don't Allow Vagrant User To su To Other Users
Product: [Fedora] Fedora Reporter: Steve Kuznetsov <skuznets>
Component: vagrantAssignee: Vít Ondruch <vondruch>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: lmohanty, madam, pvalena, strzibny, thrcka, vondruch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-14 07:53:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Steve Kuznetsov 2016-10-13 20:39:42 UTC
Description of problem:
When attempting to switch to another user, `sudo su <user>` where `<user>` is not `root` in the Vagant Fedora Cloud Base boxes does not work. This is as the contents of /etc/sudoers.d/vagrant-nopasswd are incorrect.

Version-Release number of selected component (if applicable):
Fedora-Cloud-Base-Vagrant-24-1.2.x86_64.vagrant-libvirt.box

Steps to Reproduce:
$ vagrant box add https://download.fedoraproject.org/pub/fedora/linux/releases/24/CloudImages/x86_64/images/Fedora-Cloud-Base-Vagrant-24-1.2.x86_64.vagrant-libvirt.box --name fedora/cloud-base
$ vagrant init fedora/cloud-base
$ vagrant up --provider=libvirt
$ vagrant ssh --command 'sudo useradd testuser'
$ vagrant ssh --command 'sudo --user testuser pwd'

Actual results:
Password prompt to switch users or permission denied message.

Expected results:
Successful user switch.

Additional info:
Just need to make the following patch:

diff --git a/vagrant-nopasswd b/vagrant-nopasswd
index 6b59f02..f892bc1 100644
--- a/vagrant-nopasswd
+++ b/vagrant-nopasswd
@@ -1 +1 @@
-vagrant ALL=NOPASSWD: ALL
+vagrant ALL=(ALL) NOPASSWD: ALL

Comment 1 Vít Ondruch 2016-10-14 07:51:44 UTC
Hi Steve,

Unfortunately this not the right place for such error. This is just to report issues with the package, not with the boxes. Atomic WG tracker [1] should be the right place if I am not mistaken.


[1] https://pagure.io/atomic-wg