I'm trying to implement the following functionality on Redhat:
I have a user "John" that can't be used to login directly via GDM or console or SSH.
I want to allow any user that are logged onto the system, to be able to log as "John" .
How would you do that using PAM modules or any other manner ?

1 Answer 1


You can set the login shell of user John to /sbin/nologin and then login with su -s /bin/bash John.

  • might be even better if people could use sudo which would allow to not share John password
    – Kiwy
    Mar 21, 2018 at 10:52
  • John's password could also be removed with passwd -d John because this should (as far as I remember) prevent any remote access to the account.
    – Patrick
    Mar 21, 2018 at 11:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .