LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 05-24-2008, 07:09 AM   #1
DaftDave
Member
 
Registered: Mar 2008
Posts: 34

Rep: Reputation: 15
File/Folder Permissions


Have been trying to access a certain file on my computer as an ordinary user and was denied access. So i opened a terminal and typed:

sudo su /var/log/user.log pressed Enter and typed in my root password and was still denied access.

So i then tried typing:
su /var/log/user.log pressed enter and then typed my root password but once again was denied access.

Would someone please tell me just what i am doing wrong please. I am running PCLinuxOS. Thanks all
 
Old 05-24-2008, 07:18 AM   #2
Jim44
Member
 
Registered: Feb 2006
Location: Atlanta, Georgia, USA
Distribution: Mint, Ubuntu, Centos
Posts: 52

Rep: Reputation: 15
Quote:
Originally Posted by DaftDave View Post
Have been trying to access a certain file on my computer as an ordinary user and was denied access. So i opened a terminal and typed:

sudo su /var/log/user.log pressed Enter and typed in my root password and was still denied access.

So i then tried typing:
su /var/log/user.log pressed enter and then typed my root password but once again was denied access.

Would someone please tell me just what i am doing wrong please. I am running PCLinuxOS. Thanks all
I'm not sure what you are trying to do with the file in question, but the commands you have been issuing indicate you are wanting to execute the file. I'm fairly certain that's not what you intend to do. Let me make some suggestions.

sudo more /var/log/user.log

That will show you the contents of the file a page at a time. Note that you said you entered the root password. Sudo requires your user password but it still might not work if you are not in the sudousers file.

Typing "su /var/log/user.log" is telling the system you want to switch user to /var/log/user.log and I am not surprised that didn't work.

If you are not in the sudousers list, then try this:

su
<enter the root password when asked for a password>
more /var/log/user.log
exit

Substitute your favorite editor for "more" to gain more flexibility in viewing the file.

I hope that helps.

Jim.
 
Old 05-24-2008, 07:36 AM   #3
DaftDave
Member
 
Registered: Mar 2008
Posts: 34

Original Poster
Rep: Reputation: 15
Hello Jim, i was using /var/log/user.log as an example. I was trying to view the contents of a file but was denied each time. Shall try again and let you know how i get off. Thanks for the reply and help. DD
 
Old 05-24-2008, 07:48 AM   #4
DaftDave
Member
 
Registered: Mar 2008
Posts: 34

Original Poster
Rep: Reputation: 15
Failed to gain access to the file using:
sudo more /var/log/user.log

So i tried using:
su
<entered password>
more /var/log/user.log
exit

And was successful. Thanks Jim
 
Old 05-24-2008, 07:49 AM   #5
catweasel28
Member
 
Registered: Mar 2007
Location: United Kingdom
Distribution: Mint, OpenSUSE,Dream
Posts: 68

Rep: Reputation: 17
Check file permissions

You'll need to check the permissions of the file first.

cd to the directory containing the file:
e.g. cd /var/log/

then type ls -lh followed by the name of the file:
e.g. ls -lh user.log

You'll the see all the details for the file. If the user is root and the permissions are -rw-------, you'll need to be root if you wish to read or edit the file. Type su followed by your password, then e.g
vi user.log to edit the file in vi. If you just wish to view it type cat user.log

Last edited by catweasel28; 05-24-2008 at 07:52 AM.
 
Old 05-24-2008, 08:09 AM   #6
DaftDave
Member
 
Registered: Mar 2008
Posts: 34

Original Poster
Rep: Reputation: 15
Can't thank you enough for taking the time out to print out all the info. Many thanks Catweasel28.

P.S you can call me touchwood lol
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
File/folder permissions Yig Linux - Newbie 3 11-28-2005 04:44 PM
File and folder permissions steve007 Linux - Newbie 3 06-30-2005 04:48 AM
File and Folder permissions seelk SUSE / openSUSE 9 01-28-2005 07:50 PM
File / folder Permissions bkbroil Linux - Newbie 3 10-15-2003 11:37 AM
Folder/File Permissions Question? gsmonk Linux - General 8 07-20-2003 04:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration