Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-21-2015, 07:06 PM   #1
LQ Newbie
Registered: May 2015
Posts: 2

Rep: Reputation: Disabled
Question File Permissions between users

Hello Everyone! I'm somewhat new to linux, and getting my feet wet by building my first linux server.

So what i have is an application that moves/sorts files. Another program that catalogs them.

The problem is that each app uses it's own user. So my question is if there is any way that files owned by prog1user can be read by prog2user?

I have tried doing a chmod -R 755 Directory and that has allowed the second program to see the files, but I'm guessing this has certain security risks (although I'm not so worried about the files in this directory).

Anyways I was wondering if there was a proper way to do this? OS is debian wheezy.

Old 05-21-2015, 07:14 PM   #2
Keith Hedger
Senior Member
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,473

Rep: Reputation: 618Reputation: 618Reputation: 618Reputation: 618Reputation: 618Reputation: 618
If one of the usrs only needs read permissions for the files just add that user to the user group of the girst user, that isn't as complicated as it sounds!
Old 05-22-2015, 09:59 AM   #3
LQ Newbie
Registered: May 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
That doesn't appear to work

The directories are created:
drwxr-sr-x vbox user DirName

all the files within appear as such:
-rw-r--r-- 1 vbox users FileName

so I checked /etc/group |grep vbox and see:

so user1 (my user) and user2 (cataloging app) account are in the same groups as vbox user.

So after the sorting is done, the file permission have changed to:

-rw-rw---- 1 vbox users FileName

So this is where I don't understand.
My user (user1) and user2 can see the files, can not delete them. -OK
However, the cataloging app, run under the user2 account can not see the files.

So this is when I do a chmod 755 FileName, and catalog app picks it up immediately.
Old 05-22-2015, 10:35 AM   #4
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,552

Rep: Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112
Originally Posted by IammenotyoU View Post
so user1 (my user) and user2 (cataloging app) account are in the same groups as vbox user.
That's not how it works. Files/dirs belong to a user and a group, and they have separate permissions for the owner, group members, and everyone else. The owner gets the owner's permissions, any user who is a member of the group gets the group's permissions, and everyone else gets the "other" permissions.

Two users being a part of the same group means nothing, except that both users will have group access to files belonging to that group. In this case, the files in question are in the "users" group, so any user that you want to have group access needs to also be a member of the "users" group.


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] Broken Users/Groups and File Permissions NotAComputerGuy Linux - Newbie 3 08-03-2013 09:31 AM
LXer: Linux File Permissions, Groups, and Users LXer Syndicated Linux News 1 11-04-2010 05:37 AM
Permissions: want to make a file accessible to all users chrille112 Linux - Newbie 2 03-06-2008 06:43 AM
Assigning permissions for a file to be accessed by particular users praveen kumar Linux - Networking 3 05-18-2006 11:20 AM
touch file in every users home, then change permissions paul_mat Linux - Networking 1 05-01-2006 07:06 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration