0

I created a user "sysuser" with -r option, when trying to su using another non-root user I am prompted for password.

As "sysuser" is a system account and should not login, I did not set up a password. (With sysuser I need to be able to own files and run tomcat.)

What can I do to su without password prompt? The OS is RHEL 6.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
Sri
  • 1
  • Possible duplicate of http://unix.stackexchange.com/questions/113754/allow-user1-to-su-user2-without-password – Oldskool Mar 23 '15 at 11:28
  • @oldskool, yes they look similar but I have tried the solution..doesnt work. Possibly the user I am trying to setup is system account? – Sri Mar 23 '15 at 23:17
  • 'code' auth [success=ignore default=1] pam_succeed_if.so user = martin-test auth sufficient pam_succeed_if.so use_uid user = martin 'code' Actually tried with 2 normal users too...still being prompted for password when su. – Sri Mar 24 '15 at 00:30

1 Answers1

0

With a bit of experimenting I solved my own problem. Requirement was for ANY USER to be able to su to sysuser without password prompt. Added the below line /etc/pam.d/su:

auth sufficient pam_succeed_if.so user = sysuser
Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
Sri
  • 1