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. |
/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 |
Are you trying to change a password?
In that case you want /usr/bin/passwd not /etc/passwd. |
Also, if your intention is to simply view /etc/passwd, then use the less(1) pager.
Code:
$ less /etc/passwd |
In fact, you should really use useradd/usermod/userdel tools rather than edit it directly.
http://linux.die.net/man/8/useradd http://linux.die.net/man/8/usermod http://linux.die.net/man/8/userdel |
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. |
cat /etc/passwd
|
All times are GMT -5. The time now is 08:30 AM. |