Friday, 4 May 2012

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.

1 comment:

Priyarajan said...

Hello sir,

I found your post is informative ans good for those who using Linux. So i request you to take part in my survey related to studies, because your blogging style comes under "BLOGGING RELATED TO STUDIES AND INFORMATIVE."

I am doing research on bloggers who use effectively blog for disseminate information.

I glad if u wish to participate in my research.

If you are interested please contact me through mail.

Thank in Advance