LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-23-2012, 08:25 AM   #1
itdungpt
LQ Newbie
 
Registered: Feb 2012
Posts: 20

Rep: Reputation: Disabled
user group /etc/passwd


i want disable cat /etc/passwd to all user
only root can cat /etc/passwd
 
Old 02-23-2012, 08:40 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Unneeded with shadow passwords.
 
Old 02-23-2012, 09:13 AM   #3
itdungpt
LQ Newbie
 
Registered: Feb 2012
Posts: 20

Original Poster
Rep: Reputation: Disabled
i was
chown root /etc/passwd
but all user group can cat /etc/passwd
 
Old 02-23-2012, 09:17 AM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
That is correct and desired behavior. Also, your understanding of chown may not be correct; /etc/passwd is normally owned by root.
 
Old 02-23-2012, 10:52 AM   #5
shamantony
LQ Newbie
 
Registered: Feb 2012
Posts: 8

Rep: Reputation: Disabled
Hello,

This will help you

#chmod 700 /etc/passwd

#chown root:root /etc/passwd
 
Old 02-23-2012, 11:38 PM   #6
itdungpt
LQ Newbie
 
Registered: Feb 2012
Posts: 20

Original Poster
Rep: Reputation: Disabled
chmod 700 /etc/passwd

can not login cpanel :2082
 
Old 02-25-2012, 04:56 AM   #7
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
Why do you want to hide it from other users? An external authentication might work, but then you have the home directories and the list of processes in ps with the usernames.
 
Old 02-25-2012, 07:07 AM   #8
pantdk
Member
 
Registered: Oct 2011
Location: New Delhi
Posts: 248
Blog Entries: 3

Rep: Reputation: 17
getting a error cannot find the name but it login into the console with that error & also disable the listing
[root@dk]# chmod 600 /etc/passwd
[root@dk]# su - test
id: cannot find name for user ID 501
id: cannot find name for user ID 501
[I have no name!@dk ~]$ cat /etc/passwd
cat: /etc/passwd: Permission denied
[I have no name!@dk ~]$

[root@dk]# chmod 744 /etc/passwd
[root@dk]# su - test
[test@dk~]$

in other directory that work's

[root@dk ~]# chmod 600 /dump
[root@dk ~]# su - test
[test@dk ~]$ cd /dump/
-bash: cd: /dump/: Permission denied
[test@dk ~]$ cat /dump/passwd
cat: /dump/passwd: Permission denied
[test@dk ~]$ exit
logout

/etc/passwd file have -rw-r--r-- read & write for owner which is root for group & other read-only
so when we login in any user that get's information from /etc/passwd so i think it required at lest read permission. /etc/passwd

Last edited by pantdk; 02-25-2012 at 07:22 AM.
 
  


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
problem with PASSWD SHADOW GROUP freelearn Linux - Newbie 1 02-07-2012 02:48 AM
Doubt when creating a user and checking /etc/group and /etc/passwd rosepower Slackware 9 04-18-2007 05:56 PM
/etc/group and /etc passwd files ygloo VectorLinux 3 09-21-2006 07:23 PM
/etc/passwd, /etc/shadow, /etc/group? Educate me :)! nutnut Linux - General 4 06-11-2005 07:47 PM
passwd group, what else do I need? khutze Linux - Software 0 02-13-2003 05:49 PM

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

All times are GMT -5. The time now is 09:02 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