/etc/shadow and /etc/passwd permissions question
i logged in as a root user and used a command
chmod u-s /etc/shadow i removed suid bit from the file though suid bit was not set on the file the file had permission before running the command was -r-------- and the permission was same after removing suid bit then i logged as a ordinary user and the normal user could not change own password with the command "passwd" again i set the suid bit on the file chmod u+s /etc/shadow but still the ordinary user (not root user)cannot change own passwd what should i do please help me what permission should i have to give to the file /etc/passwd for making it normal... i am using RHEL4 and the actual permission of the file is supposed to be -r-------- 1 root root 1116 Feb 20 20:36 /etc/shadow and i chaged the permission to this it is still not working i am using RHEL4 and the actual permission of the file is supposed to be -r-------- 1 root root 1116 Feb 20 20:36 /etc/shadow and i chaged the permission to this it is still not working |
welcome to LQ... please use a more adequate/descriptive title for your thread next time...
here's what passwd and shadow look like on my ubuntu box in case it helps you... Code:
win32sux@candystore:~$ ls -l /etc/shadow |
vipw -- The forgotten editor...
Did you edit /etc/passwd with something other than vipw? Such as regular vi, or emacs? You may want to reopen /etc/passwd with vipw and exit out. If vipw(8) complains about the file being locked, then you found your problem. Read vipw(8) and vigr(8) for details.
I hate to sound superstitious and paranoid, but vipw(8) and vigr(8) do *things* before and after you edit /etc/passwd and /etc/groups such as aquire/release locks and post-processing. They prevent two admins from trying to edit those files at the same time. In the event that vipw(8) hangs, dies abruptly, is suspended, or absent mindedly placed in the background BEFORE the locks are released, /etc/passwd _stays_ locked, no post-processing is performed, and the passwd(1) command will usually fail for non-root users. |
All times are GMT -5. The time now is 12:42 AM. |