I have a few scripts that use groupmems to view and modify what users are in a group. The script runs as root. In Ubuntu 18, it has started to ask for a password, even thou I run as root:

root@ubu18:~# id uid=0(root) gid=0(root) groups=0(root)

root@ubu18:~# groupmems -g adm -a uucp
groupmems: PAM: Authentication failure

Try for yourself?

docker run -it ubuntu:18.04
root@0e2d06be65c3:/# groupmems -g adm -a uucp

Any idea why? or more important: How make it stop...

Thanks, /holger

1 Answer 1


Found a solution:

cat << END > /etc/pam.d/groupmems
auth            sufficient      pam_rootok.so
account         required        pam_permit.so
password        include         system-auth(common-password)

I guess the 'pam_rootok.so' allows me to modify groups w.o. password as root:

root@19..:~# groupmems -g adm -a uucp
root@19..:~# grep adm /etc/group

thanks to https://wiki.yoctoproject.org/wiki/PAM_Integration#groupmems for solution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.