LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 02-20-2007, 09:43 AM   #1
lqchangba
LQ Newbie
 
Registered: Feb 2007
Posts: 19

Rep: Reputation: 0
/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

Last edited by lqchangba; 02-20-2007 at 10:11 AM.
 
Old 02-20-2007, 09:53 AM   #2
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
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
-rw-r----- 1 root shadow 843 2007-02-07 08:59 /etc/shadow
win32sux@candystore:~$ ls -l /etc/passwd
-rw-r--r-- 1 root root 1315 2007-02-07 08:59 /etc/passwd
PS: i'm changing this thread's title from "urgent" to "/etc/shadow and /etc/passwd permissions question"...

Last edited by win32sux; 02-20-2007 at 10:14 AM.
 
Old 02-20-2007, 12:46 PM   #3
libkarl2
LQ Newbie
 
Registered: Feb 2007
Distribution: Fedora 6, OpenBSD 4, Slackware 11
Posts: 3

Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
boot sector and lilo collapse !!!!! URGENT URGENT URGEN !!!!! frelihm Linux - Software 21 12-02-2009 10:21 AM
Urgent Question Regarding Urgent Questions! Need Help Now! Crashed_Again LQ Suggestions & Feedback 11 10-17-2007 08:07 PM
Urgent..Im Having A Nightmare..Urgent!!!! midgcool Linux - Software 41 11-30-2004 10:19 AM
URGENT! Please help :( luminousnerd Linux - Hardware 6 11-21-2004 06:57 PM
Urgent Urgent !!!! Mozilla Keeps All Your Deleted Emails !!!! odin123 Linux - Software 2 01-31-2004 02:22 AM


All times are GMT -5. The time now is 06:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration