LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-09-2002, 09:45 PM   #1
itsjvivek
LQ Newbie
 
Registered: Dec 2002
Posts: 16

Rep: Reputation: 0
Exclamation Permission denied on " ls "for root user


Dear,
i am getting permission denied for some files within my home directory using "ls" command.
Even, when the root(super-user) login is used for the same listing , i am getting a permission denied error message.
can anybody help me in explaining/tracing the above message.
as per my knowledge, the super-user can list all the files in any directory.

early response will be appreciated..

Regards
Vivek J.
 
Old 12-09-2002, 10:44 PM   #2
shelby
Member
 
Registered: Nov 2002
Location: Rio Rancho, NM
Distribution: RHEL, CentOS & Ubuntu
Posts: 90

Rep: Reputation: 15
Instead of su, try "su -" this seems to work better for me. Thansk
 
Old 12-09-2002, 11:07 PM   #3
itsjvivek
LQ Newbie
 
Registered: Dec 2002
Posts: 16

Original Poster
Rep: Reputation: 0
does "su - " affect listing of files for super-user.
 
Old 12-09-2002, 11:16 PM   #4
shelby
Member
 
Registered: Nov 2002
Location: Rio Rancho, NM
Distribution: RHEL, CentOS & Ubuntu
Posts: 90

Rep: Reputation: 15
Talking

I believe that su give you super user privleges and su - makes you the user root. Clear as mud?
 
Old 12-10-2002, 02:38 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,990
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
try this (w/o quotes): "strace ls <options> <dir or file>" and post the output here.
 
Old 12-10-2002, 08:20 AM   #6
Ciccio
Member
 
Registered: Nov 2002
Location: Paraguay
Distribution: Mandrake 10
Posts: 573

Rep: Reputation: 30
Quote:
Originally posted by shelby
I believe that su give you super user privleges and su - makes you the user root. Clear as mud?
NO! su is a command that Switches User. you actually become root when you run su, when you run su - all you do is change to root and go to the home path for root (usually /root). you can use the command su for changint to ANY user for example, you are the user john and want to change to user smith, you use the command $su - smith and if then you want to become root you run $su -

PLEASE READ man su !!!
 
Old 12-10-2002, 04:44 PM   #7
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 46
Reread the man page.
Code:
su [username]
just gives you the permissions of the username, without the environment
of that username. No username => switch user to root (uid 0, really)
Code:
su - [username]
sets up the environment of the user you have switched to. It matters,
because if you are "frodo" and you "su bilbo", you keep frodo's
environment, which means if bilbo has a different path from frodo, you
won't get what you expect for bilbo. However, if you use "su - bilbo", you
will get the environment of bilbo.
It doesn't matter that much for this question, since
Code:
 su
should give the permissions necessary to read almost any files.
How is the home disk/partition mounted? If it's mounted via NFS, root
most likely WON'T have permission to read the files, since that
permission is set by the server. If the disk is local but mounted in a funky
way, you could cause all files, but not just certain files to be unreadable.
 
Old 12-10-2002, 08:15 PM   #8
Ciccio
Member
 
Registered: Nov 2002
Location: Paraguay
Distribution: Mandrake 10
Posts: 573

Rep: Reputation: 30
anyway, If you don't use su - you wont be able to run a lot of command (since you don't have the env you dont have the path)
 
Old 12-10-2002, 11:49 PM   #9
itsjvivek
LQ Newbie
 
Registered: Dec 2002
Posts: 16

Original Poster
Rep: Reputation: 0
Output of strace command

here is an output of strace command :

orbit@avior:~/data> strace ls -l secrvr.log
 
Old 12-11-2002, 12:22 AM   #10
Meatwad
Member
 
Registered: Dec 2002
Distribution: Debian, Libranet, Red Hat
Posts: 43

Rep: Reputation: 15
Do you have read and execute privelleges to the directory in which you're trying to look in?
 
Old 12-11-2002, 02:13 PM   #11
Ciccio
Member
 
Registered: Nov 2002
Location: Paraguay
Distribution: Mandrake 10
Posts: 573

Rep: Reputation: 30
have you red the man pages of strace and ls???
 
Old 12-11-2002, 06:51 PM   #12
shelby
Member
 
Registered: Nov 2002
Location: Rio Rancho, NM
Distribution: RHEL, CentOS & Ubuntu
Posts: 90

Rep: Reputation: 15
I "red" the man pages and it blue...sorry I could not resist
 
Old 12-11-2002, 07:02 PM   #13
Ciccio
Member
 
Registered: Nov 2002
Location: Paraguay
Distribution: Mandrake 10
Posts: 573

Rep: Reputation: 30
oooooooooops, didn't see that.

Quote:
Originally posted by shelby
I "red" the man pages and it blue...sorry I could not resist
No problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Submount, "permission denied" when writing to floppy as normal user DaneM Linux - Software 5 02-22-2006 02:05 PM
Only root hears sounds, alsa gives "permission denied" Baix Linux - General 4 07-02-2005 01:30 PM
"permission denied when rcp-ing with root. ayeletr Linux - Security 7 11-24-2004 04:48 PM
why I got "Access denied for user: 'root@localhost'" likedreamer Red Hat 1 11-09-2003 05:06 AM
ls in /tmp produces "permission denied" even as root kpfeiffer Linux - Newbie 5 10-06-2002 12:40 PM


All times are GMT -5. The time now is 02:40 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration