-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-10-2007 05:34 PM
01-10-2007 05:34 PM
rwx--x-wx
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-10-2007 06:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-10-2007 06:35 PM
01-10-2007 06:35 PM
Re: umask
Sample use "umask".
$ umask 077
$ umask --> 077
$ umask -S --> u=rwx,g=,o=
$ man umask
rgs,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-2007 02:09 PM
01-11-2007 02:09 PM
Re: umask
cd /tmp
mkdir fun_umask
cd fun_umask
umask 022
touch file_with_022
ls -l file_with_022
grep umask /etc/profile
what is your systems default umask ?
now try this one:
umask 0
touch file_with_000
ls -l file_with_000
why did HP-UX provide the default umask settings ? A well known security hole, that's why..
the "touch" command provides a simple method of calling the system call function: creat().. using the umask(1) setting from the parent shell.
let me know if you need more lessons here..
best of luck and of couse we expect points, right :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-2007 02:42 PM
01-11-2007 02:42 PM
SolutionNow the umask "subtracts" (kinda sorta, but not really, but enough for this explanation) the umask bits from the default permissions.
So:
Example 1:
umask = 022
You create a file:
default perms 666 minus umask 022 = permissions on file of 644 (-rw-r--r--).
You create a directory:
default perms 777 minus umask 022 = permissions of 755 (drwxr-xr-x)
Example 2:
umask = 027
You create a file:
666 - 027 = 640 (-rw-r-----)
Create a dir:
777 - 027 = 750 (drwxr-x---)
If the umask has 4 digits, you can drop the leading 0 (as long as its a 0).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-2007 02:42 PM
01-11-2007 02:42 PM
Re: umask
For example you have umask set to 022, so when a file is created by default it gets (666-022) permission i.e 642 .
if you hav umask set to 000 , so the default file permission will be 666-000 = 666
umask on file and directory differs,
for
file = (666-umask value)
dir = (777-umask value)
Now the number convention to rwx
r w x
Owner: 400 200 100
Group: 40 20 10
Other: 4 2 1
-------------------------
So Umask 022 will provide default file creation permission to ( 666-022) = 644
i.e -rw-rw----
Hope this will help,
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-2007 02:57 PM
01-11-2007 02:57 PM
Re: umask
7 7 7
111 111 111
rwx rwx rwx
chmod 777 myfile
: provides mode 777
this assumes your umask is set to ZERO or 000
umask 000
touch myfile
ls -l myfile
mode of file is 777 or rwx-rwx-rwx
x = 1
w = 2
r = 4
=====
7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-2007 02:57 PM
01-11-2007 02:57 PM
Re: umask
Sorry, but NO. 666 - 022 = 644 which = -rw-r--r-- (try it and see!)
The numerical notations are:
(r)ead = 4
(w)rite = 2
e(x)ecute = 1
This is the same for user/owner, group and other/world.
So rwxrwxrwx = 421 421 421 = 777 (if you add each triplet together).
With the chmod command you can use 'chmod 755 file' or 'chmod u=rwx,go=rx file' to grant rwxr-xr-x permissions to a file. u=user (or owner), g=group and o=other (or world). The chmod man page explains this. (I know you didn't ask about chmod, but I'm hoping this will help you understand.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-2007 03:08 PM
01-11-2007 03:08 PM
Re: umask
if you have mode:
7 7 7
and umask is set (set to > 000), then you subtract.
example:
$ umask 022
math:
7 7 7
-
0 2 2
=====
well, the first 0 value might be interesting here.. what result do you get ?
try this one:
umask 022
touch file_junk
ls -l file_junk
do you get:
rwx-rx-rx
or
766
given: rwx = 7
rx = 5 (r=4 + x=1) = 5
again: rwx is simply the math of:
r = 4
w = 2
x = 1
=====
total 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-2007 03:18 PM
01-11-2007 03:18 PM
Re: umask
umask 0
touch file
mode is 7 7 7
or
rwx rwx rwx
umask 022
touch file2
mode is 755 <--- note 755
or
rwx r x r x
not group write, not others write
best of luck and thanks for being a member here !!
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP