LinuxQuestions.org
Review your favorite Linux distribution.
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 10-09-2012, 09:20 PM   #1
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
UNIX file permissions (can't see files)


Hi,

I am currently logged in as user2, and i was able to navigate to a directory x. In this directory, user1 has files which have the following permissions:
-rw-r--r-- user1 user1
Given that I am not with the same group as user1, I expect that I could at least see the file when I list directory contents. Is this always true to Unix? Or are there some other way that the owner (user1) hides the files from other users (such as user2)?

Thanks in advance,
Lester.
 
Old 10-09-2012, 09:22 PM   #2
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Original Poster
Rep: Reputation: 72
Btw, the problem is that, I can't see the files when I list directory contents. However, user2 has sent me a screenshot that shows the files in the said directory, with the above permissions.
 
Old 10-09-2012, 10:29 PM   #3
thesullster
LQ Newbie
 
Registered: Jul 2010
Distribution: Debian6
Posts: 4

Rep: Reputation: 0
Do you just want to see the directory/files or also be able to modify/write?
 
Old 10-09-2012, 11:09 PM   #4
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Original Poster
Rep: Reputation: 72
Hi thesullster,

I want to verify that the files are really in that directory, and based on those permissions that I had from a screenshot, I expect to see those files when I list the directory contents.

Thanks.
 
Old 10-10-2012, 12:46 AM   #5
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Rep: Reputation: 0
Quote:
Originally Posted by ilesterg View Post
Hi thesullster,

I want to verify that the files are really in that directory, and based on those permissions that I had from a screenshot, I expect to see those files when I list the directory contents.

Thanks.
As I can see the directory x has read permission for group and others. To enter a directory you need to have the execute permission too along with the read permission.
 
Old 10-10-2012, 12:55 AM   #6
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Rep: Reputation: 0
so if user1 change the permission like this you can see the files inside the directory x

Quote:
-rw-r--r-x user1 user1
 
Old 10-10-2012, 01:38 AM   #7
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Original Poster
Rep: Reputation: 72
Quote:
Originally Posted by abhinav4 View Post
so if user1 change the permission like this you can see the files inside the directory x
Hi,

That applies to directories, but I dont thinks the same applies to files. My issue is not with directory x since I was able to navigate inside it, obviously it has execute permissions for other users. My concern here are the files inside the directory x.

Thanks.

---------- Post added 10-10-12 at 02:39 PM ----------

Quote:
Originally Posted by ilesterg View Post
Hi,
In this directory, user1 has files which have the following permissions:
-rw-r--r-- user1 user1
Lester.
additional note: the 'have' here refers to the files.

Thanks.
 
Old 10-10-2012, 04:55 AM   #8
jayakrishnan
Member
 
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992

Rep: Reputation: 30
You cant even view other directory/files unless you are a SU / root
 
Old 10-10-2012, 05:37 AM   #9
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Original Poster
Rep: Reputation: 72
Quote:
Originally Posted by jayakrishnan View Post
You cant even view other directory/files unless you are a SU / root
Even if the file permission for other is "r--" ?
 
Old 10-10-2012, 11:37 PM   #10
thesullster
LQ Newbie
 
Registered: Jul 2010
Distribution: Debian6
Posts: 4

Rep: Reputation: 0
In Debian, I sometimes do this (change home directory to the directory I want to monitor/access) :

sudo usermod -d <path to the directory you want to view> <your username>
 
  


Reply

Tags
file permissions, unix


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
[SOLVED] reading unix file permissions into a bash array for processing dazdaz Programming 11 12-06-2010 03:21 PM
svn and unix file permissions davidcollins001 Linux - Software 1 05-29-2009 03:39 AM
Change file permissions of files in folders dotancohen Linux - Newbie 1 05-19-2007 02:56 AM
LXer: Speaking UNIX, Part 4: Setting and managing permissions on UNIX LXer Syndicated Linux News 0 10-21-2006 01:54 AM
Frustrated, file permissions sharing files sporks Linux - General 9 04-20-2005 08:37 PM

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

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

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
Open Source Consulting | Domain Registration