Wheel user to become as root (su -) without password

 

1. Create a user:

useradd test
passwd test

2. Add this user in wheel group.

usermod -a -G wheel test

3. Now, Edit PAM configuration file for su. (/etc/pam.d/su)

—-
vi /etc/pam.d/su

uncomment below line

auth sufficient /lib/security/$ISA/pam_wheel.so trust use_uid
This will allow users in wheel group as a trusted users.

—–

4. Login as test user.

 #su –
It will not ask for password.

OR

If we add the test user in “visudo”, we need to use “sudo su -” to become root without password.

—-
1. visudo or vi /etc/sudo
2.  Add the below line
   test    ALL=(ALL)   NOPASSWD:ALL
3. Save and exit
—-
It will also grant root privilege for the user “test”, but we need to use “sudo su -” to became as a root.
Advertisements
Leave a comment

Leave your opinion

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: