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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-17-2012, 04:24 PM
|
#1
|
LQ Newbie
Registered: Oct 2011
Location: Fort Worth Texas
Distribution: ubuntu, Red Hat, Fedora
Posts: 2
Rep: 
|
Permission denied as root for /etc/passwd
1. Signed in as root in RHEL 5 at the prompt [root@localhost ~]# and when I input the command, "/etc/passwd" the output is, bash: /etc/passwd: permission denied.
2. Next I tried to view the permissions of the file with "ls -l /etc/passwd". the output is, "-rw-r--r-- 1 root root 1980 Apr 17 15:16 /etc/passwd
It seems I have read and wite permissions for the file, and groups and users have read only.
What is you advice or suggestions?
Thanks in advance to all for your help.
Last edited by ltoni; 04-17-2012 at 04:27 PM.
Reason: clear up a bit
|
|
|
04-17-2012, 04:26 PM
|
#2
|
Member
Registered: May 2007
Location: CO
Distribution: Solaris , Redhat , Debian
Posts: 152
Rep:
|
/etc/passwd is a text file - you cannot execute it, hence the permission denied because it is not a script/program - you need to use a text edit tool like vi or nedit to edit the file
Example:
# vi /etc/passwd
Be careful editing the /etc/passwd file
Last edited by ADxD_7; 04-17-2012 at 04:27 PM.
|
|
1 members found this post helpful.
|
04-17-2012, 04:49 PM
|
#3
|
Member
Registered: Mar 2007
Location: Spain
Distribution: Debian
Posts: 202
Rep:
|
Are you trying to change a password?
In that case you want /usr/bin/passwd not /etc/passwd.
|
|
1 members found this post helpful.
|
04-17-2012, 05:43 PM
|
#4
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep: 
|
Also, if your intention is to simply view /etc/passwd, then use the less(1) pager.
(Note that you don't need to be root to view it, BTW.)
|
|
|
04-17-2012, 06:01 PM
|
#5
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,444
|
|
|
|
04-18-2012, 11:38 AM
|
#6
|
LQ Newbie
Registered: Oct 2011
Location: Fort Worth Texas
Distribution: ubuntu, Red Hat, Fedora
Posts: 2
Original Poster
Rep: 
|
Thanks for all your responses I'm still learning about he power and limits of root.
I was only trying to view /etc/passwd, and will use the command "less /etc/passwd".
Thanks again.
Last edited by ltoni; 04-18-2012 at 11:41 AM.
|
|
|
04-18-2012, 12:30 PM
|
#7
|
LQ Newbie
Registered: Apr 2012
Location: New York
Distribution: Centos,Debian
Posts: 29
Rep:
|
cat /etc/passwd
|
|
|
All times are GMT -5. The time now is 12:06 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|