LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   root permission denied (https://www.linuxquestions.org/questions/linux-newbie-8/root-permission-denied-4175583391/)

cmoore90638 06-29-2016 07:30 PM

root permission denied
 
I will apologize for the last thread I should know better then to try and explain something when I am Irritated. I did not know how much I had sent you I thought it was just the last screen not the whole session.

I have a few small problems that I need to separate out and deal with them individually.

I am running slackware 14.1.when I try to look at /etc/passwd as root it gives me a permission denied,I have tried other directories and get the same results.I have read through all the previous questions on this site that were similar, but nothing worked. I copied just the screen I was on so you might see what I was trying to do.






root@chuck:~# /
-su: /: Is a directory
root@chuck:~# /boot
-su: /boot: Is a directory
root@chuck:~# /etc
-su: /etc: Is a directory
root@chuck:~# /etc/passwd
-su: /etc/passwd: Permission denied
root@chuck:~# /user/local
-su: /user/local: No such file or directory
root@chuck:~# /home
-su: /home: Is a directory
root@chuck:~# /proc/cpuinfo.
-su: /proc/cpuinfo.: No such file or directory
root@chuck:~#

rknichols 06-29-2016 08:11 PM

When you just type the name of a file or directory, your shell tries to execute that as a command, and that's going to fail if that name is a directory or a non-executable file. If you just want to view /etc/passwd (which you can do as a non-root user, BTW), you need to run some command that will display that file on your terminal, such as
Code:

cat /etc/passwd
less /etc/passwd

... etc.

frankbell 06-29-2016 08:14 PM

Su means "substitute user." If no username is specified, it defaults to root. You do not "su" to a directory.

Code:

$ su
Password:    <---enter root password
#

You may now execute commands as root.


Code:

$ su [someuser]
Password:    <---enter password for [someuser]
#

You may now execute commands as [someuser].

See

Code:

$ man su
for more.


All times are GMT -5. The time now is 06:20 AM.