Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
Change user from user to root
Add the following lines right below the pam_rootok.so line in your /etc/pam.d/su:
auth [success=ignore default=1] pam_succeed_if.so user = root
auth sufficient pam_succeed_if.so use_uid user = user
The first line makes sure the target user is root. If it is, the next line will take control and succeed authorization if the calling user is user.
If the target user is something else, the second line will be ignored and the usual authentication steps will be performed.