You are not logged in.
Pages: 1
Topic closed
I am trying to understand the default permissions for my new Arch Linux system. It appears that the umask for my system is 0022 and when I create a directory or file, I get the following:
[carlos@tiger ~]$ umask
0022
[carlos@tiger ~]$ mkdir xyz
[carlos@tiger ~]$ touch zoo
[carlos@tiger ~]$ ls -l
total 24
drwx------ 2 carlos users 4096 2009-09-21 16:42 files
drwx------ 2 carlos users 4096 2009-09-26 13:34 iso
drwx------ 2 carlos users 4096 2009-09-21 16:42 music
drwx------ 2 carlos users 4096 2009-09-21 16:42 pics
drwx------ 2 carlos users 4096 2009-09-21 16:42 vids
drwxr-xr-x 2 carlos users 4096 2009-09-26 13:42 xyz
-rw-r--r-- 1 carlos users 0 2009-09-26 13:42 zoo
Now I am trying to understand how in Arch or Linux in general when I create any new directory as myself 'carlos', can I set the permissions on the newly created folder to 700? As well a newly create text file from 644 which appears to be the default to 700?
Thanks for any help!
./
Offline
`chmod 700 xyz` changes the permissions to rwx------
Offline
Yes - I understand how to manually alter / modify permissions however I find it annoying to do so. I can set up a cron job to run every hour that does:
chmod -R 700 /home/carlos
however I would like to know if in Linux / Arch, I can force all new directories I create as myself in my home directory as 700.
Is this possible?
./
Offline
You probably don't need that, because /home/carlos already is 700, so other users don't have access to it.
but yeah, if you want you can have a cron job to do that, i can't think of any built-in feature to do that
Offline
What is the output of "id carlos"?
All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.
Offline
If you want files and directories to inherit the parent's permissions you have to use ACLs (access control lists). Use the getfacl/setfacl/chacl commands. For more info: man acl
If you want all files and directories to be created as 0700 you could also change your umask to 0077.
Last edited by Teoulas (2009-09-26 21:39:17)
Offline
Now I am trying to understand how in Arch or Linux in general when I create any new directory as myself 'carlos', can I set the permissions on the newly created folder to 700? As well a newly create text file from 644 which appears to be the default to 700?
Directories default to 777, files to 666.
The umask gets subtracted so if you want to have 700 as default for folders set your umask to 077.
Offline
A reasonably good explanation of umask can be found at http://code.google.com/edu/tools101/lin … sions.html. Scroll down to the section titled, not surprisingly, "About umask."
Offline
Carlwill wrote:Now I am trying to understand how in Arch or Linux in general when I create any new directory as myself 'carlos', can I set the permissions on the newly created folder to 700? As well a newly create text file from 644 which appears to be the default to 700?
Directories default to 777, files to 666.
The umask gets subtracted so if you want to have 700 as default for folders set your umask to 077.
On my Linux system and everyone I have tested on the default permissions I get are 755 for directories and 644 for files. I don't know how you got 777 and 666.
./
Offline
Is your concern that the group users is getting read access to all newly created files in your homedir?
All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.
Offline
Hi Carlos,
by your name I asume you uinderstand Spanish ;-) If this is the case, you could take a look at
http://en.opensuse.org/Es.Howto_setup_p … _with_acls
is a opensuse Wiki entry (by me ;-D) that explain how to use ACL for setting up permissions and inherit permissions between folders
HTH
-
Arch64 - Acer AX3950 - i5-650 3.2 GHz - 8 GB RAM - Nvidia GeForce 320 1 GB Ram
Arch32 - Samsung NC10 - 2 GB Ram
Offline
If you're using bash, you can do the following:
echo umask 077 >> ~/.bashrc
You will need to reset your bash settings (opening a terminal should work). Now when you create files and directories you should get the following:
[tmp]$ mkdir xyz
[tmp]$ touch zoo
[tmp]$ ls -l
total 4
drwx------ 2 juken juken 4096 2009-09-29 10:49 xyz
-rw------- 1 juken juken 0 2009-09-29 10:49 zoo
Let us know how you make out.
Last edited by juken (2009-09-29 14:52:44)
Offline
On my Linux system and everyone I have tested on the default permissions I get are 755 for directories and 644 for files. I don't know how you got 777 and 666.
On most linux systems the umask defaults to 022 ;-)
So you got defaults of 111 111 111 / 110 110 110 for folders/dirs
subtracting the umask 000 010 010 (bitwise) you get 111 101 101 / 110 100 100 which is just 755 / 644
Regards,
raf
Last edited by raf_kig (2009-10-02 10:28:07)
Offline
I'm quite new to arch linux, but maybe it helps.
The global unmask default is set in /etc/profile.
On my current system (Arch Linux 2020.03.01) it was:
umask 022
Offline
It's been over 10 years, you really think the OP is still looking for a solution?
https://wiki.archlinux.org/index.php/Co … bumping%22
Last edited by Scimmia (2020-03-13 16:15:06)
Offline
Thanks for contributing, neofc. However, please pay attention to the age of threads and refrain from posting in those which are long since abandoned.
https://wiki.archlinux.org/index.php/Co … bumping%22
Closing.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Pages: 1
Topic closed