Find the answer to your Linux question:
Results 1 to 3 of 3
Hi All, I have some users authenticated with AD and some locally, I want to allow only local users and root to change their password with passwd, not users authenticating ...
  1. #1
    Just Joined! crayfishuk's Avatar
    Join Date
    Mar 2011
    Location
    London
    Posts
    5

    Using PAM to restrict ability to change password

    Hi All,

    I have some users authenticated with AD and some locally, I want to allow only local users and root to change their password with passwd, not users authenticating over AD - so far I have this in my /etc/pam.d/passswd file

    password sufficiant pam_unix.so shadow nullok audit
    password required pam_echo.so \
    You CANNOT change your password using the Linux passwd command

    password required pam_echo.so \
    You must change your windows password in Active Directory


    password requisite pam_deny.so

    account include system-auth
    password include system-auth
    password required pam_deny.so



    This works fine in allowing my normal users to change passwords and my AD users to be blocked, however, root cannot change passwords - the pam_rootok module seems only to work for auth - is there a way I can define root as a sufficiant check for password?

    Thanks in advance.
    Craig

  2. #2
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    665
    you should be able to just add

    auth sufficient pam_rootok.so

    to the top of your file to make that the first checked item.

    I haven't messed around with this type of scenario, so I can't say for certain if it'll work or not.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  3. #3
    Just Joined! crayfishuk's Avatar
    Join Date
    Mar 2011
    Location
    London
    Posts
    5
    Quote Originally Posted by meton_magis View Post
    you should be able to just add

    auth sufficient pam_rootok.so

    to the top of your file to make that the first checked item.

    I haven't messed around with this type of scenario, so I can't say for certain if it'll work or not.
    I tried that, doesn't work - I presume because auth sufficient will only pass future auth services and doesn't affect the outcome of password modules?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...