LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Linux File Permissions - Need some help. (https://www.linuxquestions.org/questions/linux-networking-3/linux-file-permissions-need-some-help-149975/)

richcom23 02-24-2004 11:21 AM

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!

marghorp 02-24-2004 11:33 AM

Try changing it with chown and assign the rights to the entire group.

richcom23 02-24-2004 12:14 PM

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?

marghorp 02-24-2004 12:29 PM

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.

richcom23 02-24-2004 01:30 PM

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.

marghorp 02-24-2004 01:43 PM

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).

richcom23 02-24-2004 01:51 PM

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.


All times are GMT -5. The time now is 10:23 AM.