LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-24-2004, 11:21 AM   #1
richcom23
LQ Newbie
 
Registered: Feb 2004
Location: Michigan
Posts: 4

Rep: Reputation: 0
Linux File Permissions - Need some help.


I've been running a Linux Red Hat 8 box for about a year now. I only use it for Samba file server, I use Win XP Pro on my 2 other boxes.

Each PC has it's own user name and password, but they are both members of the same group in linux. I have a shared directory that both can access and use. The problem I am having (which only started recently for some reason) is when one of the machines opens a file, and then changes, or edits it, then the file "belongs" to that user. When the other pc that did not edit this file tries to open it, it goes into READ-ONLY mode.

How can I change this so the owner does not change when someone edits a file? I have went into Konqueror and right clicked everything and changed the permissions that way... I have tried a few commands like "chmod" and "chgrp" thinking that would do somthing... well, maybe I don't know WTH I'm doing cuz I can't seem to figure it out.

Any help is greatly appreciated!
 
Old 02-24-2004, 11:33 AM   #2
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
Try changing it with chown and assign the rights to the entire group.
 
Old 02-24-2004, 12:14 PM   #3
richcom23
LQ Newbie
 
Registered: Feb 2004
Location: Michigan
Posts: 4

Original Poster
Rep: Reputation: 0
The command chown is a bit confusing to me in format. Would it be possible to get an example to chown an entire directory. For example, say the directory "Documents" being changed to the group "Friends"

This would be greatly appreciated.

Oh, and if I do this will it automatically change EVERYTHING in that folder to be the same way? Subdirectories and all?

Last edited by richcom23; 02-24-2004 at 12:18 PM.
 
Old 02-24-2004, 12:29 PM   #4
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
use it like this :

chown -R user:group directory_name/

-R stands for recursive (which means it takes subdirectories and all the files in them also)

user is the user which is the owner of these files and subdirectories
group is the group of which users will have acces to these files and subdirectories
directory_name you know what stands for

So you asked for an example:

try something like:
chown -R user:Friends Documents/

P.S.: You have to use the whole path to the documents folder if you are not infront of it. And of course replace user wiht some existing user.
 
Old 02-24-2004, 01:30 PM   #5
richcom23
LQ Newbie
 
Registered: Feb 2004
Location: Michigan
Posts: 4

Original Poster
Rep: Reputation: 0
Ok thanks much for all your help. Everything works now normally except for 1 thing :/ My Microsoft Access Database isn't working normally.. When I look at the group ownership, the rwx permissions etc. in Konqueror everything is fine. As soon as I open the database, it creates a file called "Database.ldb" only while the database is open, must be some sort of temporary file Access uses.. Well, that file is set for Read only. So while I have the database open I can use it, but no one else can open it. Vice versa.

I can manually change the permissions of this file and everything works fine... the problem being once everyone closes out of Access and the file dissapears... the next time its reopened it's back to its default permissions and only lets 1 user access it.

So let me ask you this. Is there any way to make it so that ANY NEW file will have the proper permissions set up from the start in this kind of scenario. A mask of some sort?

(Aggrivating situation seeing how this worked fine for a year, exactly the way it was supposed to so I know it's possible. Not sure what got messed up or changed recently to cause all these problems.)

Oh and Oplocks are set to off in my samba config file, which was a requirement for more than 1 person to Access databases like this off from a Linux box.

Last edited by richcom23; 02-24-2004 at 01:43 PM.
 
Old 02-24-2004, 01:43 PM   #6
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
I know it is possible, but I don't know how. Maybe changing the ownership of the directory the database is in and changing the mod of the directory makes the new files as the directory in which they reside. You can try that, but I don't guarantee it will do anything helpful. Don't do it recursive though (do it without -R).
 
Old 02-24-2004, 01:51 PM   #7
richcom23
LQ Newbie
 
Registered: Feb 2004
Location: Michigan
Posts: 4

Original Poster
Rep: Reputation: 0
I think I just found something that I forgot a long time ago from another post I made. In samba you can set the umask which I beleive is the default settings for a new file created. For kicks I set the mask to 777 in samba and now everything works. Now I have to see what the more secure setting is as I beleive that this allows everything - which probably isn't good. But at least I think I'm on the right track!

Thanks again for all your help, I appreciate it greatly, I learned some new stuff.
 
  


Reply



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
DISCUSSION: Quick and Dirty Guide to Linux File Permissions bulliver LinuxAnswers Discussion 32 12-19-2011 10:36 PM
Clarification of Linux File Permissions AlistairH Linux - Newbie 2 11-08-2005 04:03 PM
Linux file permissions soccertux Linux - General 3 03-18-2005 01:51 PM
Linux file permissions jamrock Linux - Networking 3 05-19-2003 12:24 PM
samba and linux file permissions? gene12 Linux - Networking 1 08-05-2002 02:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:27 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
Open Source Consulting | Domain Registration