Sponsored Content
Full Discussion: setting daemon umask
Operating Systems Linux setting daemon umask Post 302087892 by Corona688 on Thursday 7th of September 2006 12:51:09 AM
Old 09-07-2006
Something like '/etc/init.d/service restart'
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

setting umask in FreeBSD 5.4

Hi, I need to change my umask from 22 to 0022. FreeBSD 5.4 has different way of looking at 22 and 0022. Untill 4.11 stable 022 and 0022 were same. Can anyone help me? Thanks in advance. Jimmy (0 Replies)
Discussion started by: jimmynath
0 Replies

2. AIX

umask setting on a logon script

hi, am new to AIX. i have an issue. iam asked to change the umask setting on a logon script on a server to prevent writable files. i logged in as the root user and typed in umask and it displays 022, which i believe is 755 for direc and 644 for files. 1) how to I identify where the logon script... (2 Replies)
Discussion started by: karthikosu
2 Replies

3. Shell Programming and Scripting

umask setting

dear all, i'm trying to set the default permission using umask commnd. i'm using bash shell and the permission of the .bash_profile file is -rwxr-x--- 1 tdmscrdr dba 370 Nov 7 12:21 .bash_profile but still i'm not able to change the default permissiom. in the .bash_profile... (1 Reply)
Discussion started by: panknil
1 Replies

4. UNIX for Dummies Questions & Answers

UMASK setting

How can we set the Sticky bit in the umask itself. Please help me :confused: I tried to set like umask 1000 but when I run umask, the value of umask is 00 (0 Replies)
Discussion started by: geniman2004
0 Replies

5. AIX

default umask setting during ftp

Hi all, How do i change the default primary group of files uploaded in AIX (via ftp) in such a way that the files will be owned by tom:staff? I understand that the default file permission can be set in /etc/profile for aix by adding a new line umask=032 Do I add a line in umask as well?... (5 Replies)
Discussion started by: chipahoys
5 Replies

6. UNIX for Dummies Questions & Answers

Setting umask 022 by default to my profile

Hello everyone, I want to set my properties of my profile to umask 022 by default. I have an idea that i need to make the change in .profile file. Can you please help me, on how would i be able to set it. Thanks, Abhishek S. (4 Replies)
Discussion started by: abhisheksunkari
4 Replies

7. Shell Programming and Scripting

Setting default permissions without umask or cron jobs

I've got a number of people sending files to me in different directory structures, and users on many different groups who need access to these incoming paths. My problem is that umask assumes a default of 666 for files. No execute bit, meaning that my users can't even see the incoming folders.... (2 Replies)
Discussion started by: Karunamon
2 Replies

8. Shell Programming and Scripting

Setting up a Daemon in UNIX

I have scheduled a crontab job in AIX 6.1 OS to run twice in an hour which runs for the whole day to process a load. The load which crontab kicks off needs files to arrive at a particular directory and if the files arrive, I process them. It so happens that for the 24 times the crontab... (2 Replies)
Discussion started by: gaugeta
2 Replies

9. UNIX for Dummies Questions & Answers

Default umask setting during ftp AIX

Hi, I have set below option in following file /etc/inetd.conf in AIX. ftp stream tcp6 nowait root /usr/sbin/ftpd ftpd -u 2 But still it created the file with permission (640): -rw-r----- 1 ftptosas ftpusrg 6091 Jul 28 12:23 diff_061920.txt Required permission... (1 Reply)
Discussion started by: mageshpsv01
1 Replies
umask(1)                                                                                                                                  umask(1)

NAME
umask - get or set the file mode creation mask SYNOPSIS
/usr/bin/umask [-S] [mask] sh umask [ooo] csh umask [ooo] ksh umask [-S] [mask] The umask utility sets the file mode creation mask of the current shell execution environment to the value specified by the mask operand. This mask affects the initial value of the file permission bits of subsequently created files. If umask is called in a subshell or separate utility execution environment, such as one of the following: (umask 002) nohup umask ... find . -exec umask ... it does not affect the file mode creation mask of the caller's environment. For this reason, the /usr/bin/umask utility cannot be used to change the umask in an ongoing session. Its usefulness is limited to checking the caller's umask. To change the umask of an ongoing session you must use one of the shell builtins. If the mask operand is not specified, the umask utility writes the value of the invoking process's file mode creation mask to standard out- put. sh The user file-creation mode mask is set to ooo. The three octal digits refer to read/write/execute permissions for owner, group, and other, respectively (see chmod(1), chmod(2), and umask(2)). The value of each specified digit is subtracted from the corresponding ``digit'' spec- ified by the system for the creation of a file (see creat(2)). For example, umask 022 removes write permission for group and other. Files (and directories) normally created with mode 777 become mode 755. Files (and directories) created with mode 666 become mode 644). o If ooo is omitted, the current value of the mask is printed. o umask is recognized and executed by the shell. o umask can be included in the user's .profile (see profile(4)) and invoked at login to automatically set the user's permissions on files or directories created. csh See the description above for the Bourne shell (sh)umask built-in. ksh The user file-creation mask is set to mask. mask can either be an octal number or a symbolic value as described in chmod(1). If a symbolic value is given, the new umask value is the complement of the result of applying mask to the complement of the previous umask value. If mask is omitted, the current value of the mask is printed. The following option is supported: -S Produces symbolic output. The default output style is unspecified, but will be recognized on a subsequent invocation of umask on the same system as a mask operand to restore the previous file mode creation mask. The following operand is supported: mask A string specifying the new file mode creation mask. The string is treated in the same way as the mode operand described in the chmod(1) manual page. For a symbolic_mode value, the new value of the file mode creation mask is the logical complement of the file permission bits por- tion of the file mode specified by the symbolic_mode string. In a symbolic_mode value, the permissions op characters + and - are interpreted relative to the current file mode creation mask. + causes the bits for the indicated permissions to be cleared in the mask. - causes the bits of the indicated permissions to be set in the mask. The interpretation of mode values that specify file mode bits other than the file permission bits is unspecified. The file mode creation mask is set to the resulting numeric value. The default output of a prior invocation of umask on the same system with no operand will also be recognized as a mask operand. The use of an operand obtained in this way is not obsolescent, even if it is an octal number. OUTPUT
When the mask operand is not specified, the umask utility will write a message to standard output that can later be used as a umask mask operand. If -S is specified, the message will be in the following format: "u=%s,g=%s,o=%s ", owner permissions, group permissions, other permissions where the three values will be combinations of letters from the set {r, w, x}. The presence of a letter will indicate that the correspond- ing bit is clear in the file mode creation mask. If a mask operand is specified, there will be no output written to standard output. Example 1: Using the umask Command The examples in this section refer to the /usr/bin/umask utility and the ksh umask builtin. Either of the commands: umask a=rx,ug+w umask 002 sets the mode mask so that subsequently created files have their S_IWOTH bit cleared. After setting the mode mask with either of the above commands, the umask command can be used to write the current value of the mode mask: example$ umask 0002 The output format is unspecified, but historical implementations use the obsolescent octal integer mode format. example$ umask -S u=rwx,g=rwx,o=rx Either of these outputs can be used as the mask operand to a subsequent invocation of the umask utility. Assuming the mode mask is set as above, the command: umask g-w sets the mode mask so that subsequently created files have their S_IWGRP and S_IWOTH bits cleared. The command: umask --w sets the mode mask so that subsequently created files have all their write bits cleared. Notice that mask operands r, w, x, or anything beginning with a hyphen (-), must be preceded by - to keep it from being interpreted as an option. See environ(5) for descriptions of the following environment variables that affect the execution of umask: LANG, LC_ALL, LC_COL- LATELC_CTYPE, LC_MESSAGES, and NLSPATH. The following exit values are returned: 0 The file mode creation mask was successfully changed, or no mask operand was supplied. >0 An error occurred. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ chmod(1), csh(1), ksh(1), sh(1), chmod(2), creat(2), umask(2), profile(4), attributes(5), environ(5), standards(5) 23 Jun 2005 umask(1)
All times are GMT -4. The time now is 11:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy