LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 02-14-2007, 04:40 PM   #1
Pinkks
LQ Newbie
 
Registered: Feb 2007
Distribution: SUSE 10.2
Posts: 8

Rep: Reputation: 0
Default file and directory permissions


I am still very new to Linux, and am using SUSE 10.2 to run a PDC for a Win XP network. Command line is not yet my thing, so I rely on the KDE GUI.

I did not take too long to get the PDC working and Samba set up and running more generally - especially the "quirk" that Samba users must be added manually! I now have a dozen or so users in a small charity beavering away on the new system.

Live running has flagged an issue. I want the permissions on files/folders in our shared filestore to be owner and group view/modify and others forbidden. I set the permissions as this when the disks were installed.

However, I have noticed that whenever anyone creates or edits a file/folder and saves the changes they appear to inherit permissions from somewhere other than the parent folder. This default is owner view/modify, group view and others forbidden.

Can someone explain how I set the default to Owner and group view/modify? My users are still being patient with me as they know I am a hobbiest on a steep learning curve but at the ned of the day they have a job to do, so the honeymoon period could be short-lived... gulp!

Any advice appreciated.
 
Old 02-14-2007, 04:55 PM   #2
kwidner
LQ Newbie
 
Registered: Feb 2007
Distribution: SuSE 10.2
Posts: 5

Rep: Reputation: 0
A decent explanation here: http://floppix.ccai.com/umask.html
 
Old 02-14-2007, 05:10 PM   #3
Pinkks
LQ Newbie
 
Registered: Feb 2007
Distribution: SUSE 10.2
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks. I follow the theory but changing umask to 026 using #umask 026 does not seem to make any difference. Must I stop/restart a process or something?

The previous umask was actually 022, i.e. Owner full control and group/others view.
 
Old 02-15-2007, 12:30 PM   #4
v00d00101
Member
 
Registered: Jun 2003
Location: UK
Distribution: Devuan Beowulf
Posts: 514
Blog Entries: 1

Rep: Reputation: 37
Code:
chmod 660 somefilename

or

chmod 770 somefilename
0660 = user rw, group rw, other no access
0770 = user rwx, group rwx, other no access

Basically the legend for it is:

1=execute
2=write
4=read

So to get read, write for a user and group you would do the following.

user= 2+4 = 6
group= 2+4 = 6
other= 0 = 0

There is a fourth set as well before user (0000), but you probably shouldnt worry about those for now.

[edit]
Nevermind, yours is a different problem, maybe the above will help you at some point though.
[/edit]

Last edited by v00d00101; 02-15-2007 at 12:32 PM.
 
Old 02-15-2007, 02:14 PM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
1=execute
2=write
4=read

[edit]
Nevermind, yours is a different problem, maybe the above will help you at some point though.
[/edit]
The umask bit are eliminated from the 777 mask during a call to open.

So umask 022 means 777-022 = 755 (group and others have no write access)

Umask is a mask of bits you want to remove.

Is samba using the umask?
 
Old 02-17-2007, 04:06 PM   #6
Pinkks
LQ Newbie
 
Registered: Feb 2007
Distribution: SUSE 10.2
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks guys and apologies for not coming back sooner but the day job got in the way.

I think I have solved the problem (nearly).

I think Samba was the problem as suggested. In the Samba Control Centre (accessible from the menus, not the Samba Service in YaST) you can set create and directory masks in the Advanced tab when you edit shares. The create mask was 0744 and the directory mask was 0755.

You can use check boxes to give the desired permissions and the GUI tells you the number (handy!). However, unless I am doing something wrong, if you change the values there, which is really easy to do and understand, you seem to trash the shares when you save the changes. I have recovered that position and not tested quite why as it is a hassle in a running system.

What I did was to use the YaST Samba Service and edited the shares from there, adding “Directory mask = 0770” and “Create mask = 0770”. I restarted Samba in the same way as you have to if adding users – do not know whether that was necessary - and have ended up with wrxwr----, i.e. missing the x on group.

I am not sure why group has received wr- and not wrx but it is unlikely that that will affect my users, at least in the short term!

Anyway, your input to the issue helped me understand the permission structures and helped me make the changes in Samba, so many thanks for that.

Let's hope this problem is solved!
 
  


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
Default directory and file permissions kodon Slackware 12 02-13-2020 01:49 PM
default permissions for home directory gerghk Slackware 2 11-02-2006 01:01 AM
Default directory permissions gwroy20 Linux - Software 7 08-28-2005 04:30 PM
directory permissions reverting to default Edrin Linux - Newbie 4 11-18-2004 11:05 AM
Default Directory Permissions tranquil222 Linux - Software 8 05-20-2004 05:10 PM

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

All times are GMT -5. The time now is 08:12 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