LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-31-2010, 08:24 AM   #1
challavijay
LQ Newbie
 
Registered: Jul 2010
Posts: 3

Rep: Reputation: 0
How can the non-root users change their password if.......


Hi fnds,
This is my first thread. Nice to meet you all.
I have one question regarding the file permissions of /etc/passwd in fact it has permissions like rw-r--r--so it says others have only
read only permissions but my questions is if others has read only permissions on /etc/passwd file.how they are able to change their password i.e others are able to change their passwords then how it is possible.

please let me know how it works
Thank you in advance
 
Old 07-31-2010, 08:32 AM   #2
djsmiley2k
Member
 
Registered: Feb 2005
Location: Coventry, UK
Distribution: Home: Gentoo x86/amd64, Debian ppc. Work: Ubuntu, SuSe, CentOS
Posts: 343
Blog Entries: 1

Rep: Reputation: 72
I'd presume that when passwd is called, it creates a process with the abilty to write to this file (as root) after checking the user is authorised.

The reason everyone can read it is so that other processes may check the given password is correct, but may not change the password.
 
Old 07-31-2010, 08:40 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,762

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
It's because /usr/bin/passwd runs suid root
Read this for a complete explanation

Regards
 
Old 07-31-2010, 02:55 PM   #4
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,093

Rep: Reputation: 197Reputation: 197
bathory answered your question but I'll add that unless you're running a version of *nix from several decades ago, passwords are stored in /etc/shadow, not /etc/passwd.
 
  


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
How could normal user obtain root password or change root password ckamheng Debian 18 02-18-2009 10:28 PM
Change my root password in Debian Linux if I have the current password? panseluta Linux - Newbie 2 12-28-2008 02:02 AM
RHEL5 Users cannot change password, but root can ggiwtc Linux - Server 2 12-10-2008 02:56 PM
change Root Password even if the password in the grub is also set sheelnidhi Linux - General 6 08-30-2006 07:27 AM


All times are GMT -5. The time now is 09:04 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration