Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> More File Permission Problems
ishcoleobo
post Sep 5 2003, 12:25 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 5-August 03
Member No.: 1,205



I made a previous post about file permissions and chown'ing the folder and so on and so forth. I am still having problems when new files are made. When we make a new file I need the permissions to be set automatically to 774 in stead of whatever it is setting it as. It won't let group members write to the file. Once again, I am using Red Hat 9.

Thanks for the help,
Russell
Go to the top of the page
 
+Quote Post
hughesjr
post Sep 5 2003, 01:40 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



You need to set the umask of the user(s) to 0002.

You can set it in each users .bash_profile ... or if you want it set that way for every user on the system, you can remove any umask commands from the user's .bash_profile and set it in the system's bash setup file at /etc/bashrc. Since there is already a umask statement in the /etc/bashrc file (at least on my PC), that is where I would change it. My current /etc/bashrc says this:
CODE
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
   umask 002
else
   umask 022
fi


(that has normal users (with a user ID of 100 or higher) with a umask of 002 and root or low id's [less than 100] have 022)

SO ... if you want users with high id's to create files with 664 then change it to this:

CODE
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
   umask 0002
else
   umask 0022
fi


If your distro doesn't do /etc/bashrc ... then you can simply put the statement:

umask 0002

in each users .bash_profile.

To see what the users current umask is, type the command umask at the command prompt while logged in as that user.

The extra zero (0002 vice 002) is for created directories

notes:
... files will only be created as 664 because you can't use umask to create a file that has 777 ... even if umask is 0000, it will only create files with 666 (rw-rw-rw-) .. you must use chmod to make a file executable...


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
ishcoleobo
post Sep 5 2003, 02:40 PM
Post #3


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 5-August 03
Member No.: 1,205



That did not work, the server is already set to do that. I tried both ways and had no luck. Any other ideas???
Go to the top of the page
 
+Quote Post
ishcoleobo
post Sep 5 2003, 03:43 PM
Post #4


Whats this Lie-nix Thing?
*

Group: Members
Posts: 9
Joined: 5-August 03
Member No.: 1,205



I found a solution surfing around the internet. Just for future problems, it was fixed by adding this to smb.conf [Shared] - section:

force group = staff

force create mode = 774
create mode = 774
force directory mode = 774
directory mode = 774

Almost what you guys said... just needed that force create line.

Again, Thanks for the help,
Russell
Go to the top of the page
 
+Quote Post
hughesjr
post Sep 5 2003, 04:04 PM
Post #5


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



I didn't read your other post ... I thought the file creation problems where while logged in to the Linux machine not via samba from windows....sorry tongue.gif


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th October 2017 - 04:37 AM