LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-02-2020, 09:13 AM   #1
lohin
LQ Newbie
 
Registered: Jan 2020
Posts: 1

Rep: Reputation: Disabled
Need to know how passwd command work's at the backend.


Hello Guys,

I am new to Linux and was thinking,

How come the normal user can change his/her own password using passwd command, where as the permission of /etc/passwd file is 644?

Could you please assist me in understanding on how the things work at the backend when trying to perform above.


Thank you for your support
 
Old 01-02-2020, 09:16 AM   #2
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
/etc/passwd does not contain passwords , only info about the user accounts. Passwords are stored in /etc/shadow which is readable only by the root user. The passwords are hashed and are not retrievable via the file. The strength of the hash is distro dependent.
 
1 members found this post helpful.
Old 01-02-2020, 09:34 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,987

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
the command passwd itself is setuid, that means it will run as the user of the owner of the /usr/bin/passwd file (which is root), not as the current user. And (obviously) root has right to do the job.

Last edited by pan64; 01-02-2020 at 09:57 AM.
 
2 members found this post helpful.
Old 01-02-2020, 09:41 AM   #4
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
Thanks pan64 - that was the part I was missing. I thought that was how it worked but wasn't sure.
 
  


Reply



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
Brother HL-2240-R Stopped - Backend /usr/lib/cups/backend/usb does not exist! jet222jet Linux - Hardware 2 12-28-2020 06:32 PM
Changing LQ passwd vs changing passwd AND username. stf92 LQ Suggestions & Feedback 7 08-06-2010 09:54 AM
Turn KnoppMyth backend/frontend into backend only nebbus Linux - General 0 09-09-2007 01:57 AM
Swat uses PAM but changes linux passwd not samba passwd Peter@KKVS Linux - Networking 0 11-26-2006 04:20 AM
Is a Linux sys w/o any passwd's as secure as a microsoft windows sys w/no passwd? t3gah Linux - Security 4 04-22-2005 08:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:35 AM.

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
Open Source Consulting | Domain Registration