Description of problem: Tried to set the password of a user created with "kuser". sudo passwd <user> SELinux is preventing /usr/bin/passwd from 'create' accesses on the file nshadow. ***** Plugin catchall_labels (83.8 confidence) suggests ******************** If you want to allow passwd to have create access on the nshadow file Then you need to change the label on nshadow Do # semanage fcontext -a -t FILE_TYPE 'nshadow' where FILE_TYPE is one of the following: faillog_t, krb5_host_rcache_t, lastlog_t, passwd_file_t, pcscd_var_run_t, shadow_t. Then execute: restorecon -v 'nshadow' ***** Plugin catchall (17.1 confidence) suggests *************************** If you believe that passwd should be allowed create access on the nshadow file by default. Then you should report this as a bug. You can generate a local policy module to allow this access. Do allow this access for now by executing: # grep passwd /var/log/audit/audit.log | audit2allow -M mypol # semodule -i mypol.pp Additional Information: Source Context unconfined_u:unconfined_r:passwd_t:s0-s0:c0.c1023 Target Context unconfined_u:object_r:etc_t:s0 Target Objects nshadow [ file ] Source passwd Source Path /usr/bin/passwd Port <Unknown> Host (removed) Source RPM Packages passwd-0.78.99-3.fc18.x86_64 Target RPM Packages Policy RPM selinux-policy-3.11.1-98.fc18.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name (removed) Platform Linux (removed) 3.9.11-200.fc18.x86_64 #1 SMP Mon Jul 22 21:04:50 UTC 2013 x86_64 x86_64 Alert Count 3 First Seen 2013-08-01 07:40:05 BST Last Seen 2013-08-01 07:40:54 BST Local ID 3b26c030-9e43-4398-b2e8-c779a80ff281 Raw Audit Messages type=AVC msg=audit(1375339254.519:383): avc: denied { create } for pid=1849 comm="passwd" name="nshadow" scontext=unconfined_u:unconfined_r:passwd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file type=SYSCALL msg=audit(1375339254.519:383): arch=x86_64 syscall=open success=no exit=EACCES a0=7f7a3901ac52 a1=241 a2=1b6 a3=238 items=0 ppid=1790 pid=1849 auid=1000 uid=1002 gid=1002 euid=0 suid=0 fsuid=0 egid=1002 sgid=1002 fsgid=1002 ses=1 tty=pts1 comm=passwd exe=/usr/bin/passwd subj=unconfined_u:unconfined_r:passwd_t:s0-s0:c0.c1023 key=(null) Hash: passwd,passwd_t,etc_t,file,create audit2allow #============= passwd_t ============== allow passwd_t etc_t:file create; audit2allow -R require { type passwd_t; } #============= passwd_t ============== files_manage_etc_files(passwd_t) Additional info: reporter: libreport-2.1.5 hashmarkername: setroubleshoot kernel: 3.9.11-200.fc18.x86_64 type: libreport
Looks like we need a transition rule for this. sesearch -T -s passwd_t | grep nshadow type_transition passwd_t etc_t : file shadow_t "nshadow"; Or /etc/nshadow is mislabeled restorecon -v /etc/nshadow
*** This bug has been marked as a duplicate of bug 990874 ***