umask usage


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting umask usage
# 1  
Old 05-02-2011
umask usage

Hi ,

i am facing small issue if anybody help appreciated.
how can we give the default permissions as 777 for files by using umask command..

advance thank you..

regards
rajeshSmilie
# 2  
Old 05-02-2011
umask can force a bit off, but it can't force a bit on. umask 0 allows all of the bits that a programmer cares to set. You cannot force all files to 777.
# 3  
Old 05-02-2011
umask

hi perderabo,

thank you for your reply.

can you explain the proper reason for that?

thank you.
regards
rajesh

Last edited by rajesh_pola; 05-02-2011 at 12:50 PM.. Reason: name missed.
# 4  
Old 05-02-2011
That's just the way it works. Unix commands were setting too many bits and it was not very secure because of it. umask was conceived as a way to tighten security. You're trying to loosen security... not much demand for that.
# 5  
Old 05-02-2011
'umask' is a subtractive value, so files and directories are evaluated differently.
Code:
umask 000; touch filename.txt

will have a octal value of 666 and,
Code:
umask 000; mkdir new_directory

will have an octal value of 777

You cannot set a 'umask' for files = '777'

Last edited by AlphaLexman; 05-02-2011 at 10:14 PM..
# 6  
Old 05-03-2011
In other words, all files does not require the execute permission. which is the final 1 in the 7.

But the directories require, with which you can navigate to that directory.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Memory usage per user,percent usage,sytem time in ksh

Let's say i have 20 users logged on Server. How can I know how much memory percent used each of them is using with system time in each user? (2 Replies)
Discussion started by: roy1912
2 Replies

2. UNIX for Dummies Questions & Answers

Command to display the space usage (memory usage) of a specific directory.

Hi all, Can you please tell me the command, with which one can know the amount of space a specific directory has used. df -k . ---> Displays, the amount of space allocated, and used for a directory. du -k <dir name> - gives me the memory used of all the files inside <dir> But i... (2 Replies)
Discussion started by: abhisheksunkari
2 Replies

3. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

4. UNIX for Dummies Questions & Answers

Umask

I need to set a umask of 022 for my ssh sessions, or within my profile. I have set the umask in both bash_profile and bashrc. and when i run umask i get 0022 but when i create a file i get, # touch test.txt # ls -l test.txt -rw------- 1 root root 0 Apr 26 12:25 test.txt it seems like... (1 Reply)
Discussion started by: felix001
1 Replies

5. Solaris

current CPU usage, memory usage, disk I/O oid(snmp)

Hi, I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP. I want the oids for above tasks. can you please tell me that Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies

6. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

7. UNIX for Dummies Questions & Answers

umask

Hi, I have a doubt on the umask values. Why is the UMASK value is different from file and directory? Suppose if the umask value is 0022. The file permissions for a newly created file is 644 and the file permissions for a newly created directory is 755. My doubt is why can't it be the... (1 Reply)
Discussion started by: praveen_b744
1 Replies

8. AIX

Umask help

I changed the umask in /etc/security/user to 027. I changed the umask in /etc/profile to 027. My current shell is ksh. My .profile doesn't make any changes to umask or call other scripts that change umask. Running AIX 5.3 I still get a umask of 022 instead of the expected 027. I have no... (1 Reply)
Discussion started by: x96riley3
1 Replies

9. UNIX for Dummies Questions & Answers

umask

the umask on solaris must return 022 or 0022 wich one is correct and why? thanks, pa (2 Replies)
Discussion started by: rsh
2 Replies

10. UNIX for Dummies Questions & Answers

umask

in this unix book that i have, it says: the statement: filedes = open(pathname, O_CREAT, mode); is actually filedes = open(pathname, O_CREAT, (~mask)&mode); /* ~ is the negation symbol */ like it's doing some type of masking. for example, fd =... (1 Reply)
Discussion started by: bb00y
1 Replies
Login or Register to Ask a Question