You are not logged in.
Pages: 1
hello,
i have changed the settings from /home/user to an other rule. now i have some problems.
how can i change it to the rules, that an arch linux /home/user folder has at standard?
chmod -c -R ???? /home/user
can you say me, what 4 numbers i must wrote instead of "????" to make rules to the standard, that all users on a fresh linux system has, when that user was created for /home/user ?
and also the number for upper folder /home pls
please also say the number for sticky,SUID and SGID.
can you help me please?
Last edited by lo7777799 (2025-05-01 10:28:34)
Offline
On Arch the default is to set home directories to 0700. For the files within, the default umask of 022 is applied (so 755 for directories, 644 for files)
# Default initial "umask" value used by login(1) on non-PAM enabled systems. # Default "umask" value for pam_umask(8) on PAM enabled systems. # UMASK is also used by useradd(8) and newusers(8) to set the mode for new # home directories if HOME_MODE is not set. # 022 is the default value, but 027, or even 077, could be considered # for increased privacy. There is no One True Answer here: each sysadmin # must make up their mind. UMASK 022 # HOME_MODE is used by useradd(8) and newusers(8) to set the mode for new # home directories. # If HOME_MODE is not set, the value of UMASK is used to create the mode. HOME_MODE 0700
Mod note: Moving to NC.
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
ok thanks,
what should i do to set /home to 0700 and umask to 022 and directories to 755 and files to 644 ?
Offline
Not sure what you're asking, you apparently are aware of http://man.archlinux.org/man/core/coreutils/chmod.1.en
However, "$HOME" is supposed to be 700 - "/home" isn't - it defaults to 755
Offline
ok thanks, seth
and how can i make files to 0644 without making directories to change from 0700 to 0644 ? what is a "default umask"?
Offline
ok thanks, seth
and how can i make files to 0644 without making directories to change from 0700 to 0644 ? what is a "default umask"?
You are an Arch user, you are expected to do research. You should be able to search the Arch Wiki for this information.
Offline
and how can i make files to 0644 without making directories to change from 0700 to 0644 ? what is a "default umask"?
Use this simple script, for example, I named it np (normalize permissions, but you can name it as you wish).
#!/bin/bash
# directory permissions to set
DP=775
# file permissions to set
FP=664
if [ -z "$1" ]; then
echo "usage: $0 name [name ...]" 2>&1
exit 1
fi
for f in "$@"; do
find "$f" -type d -exec chmod $DP {} \;
find "$f" -type f -exec chmod $FP {} \;
done
Change DP and FP variables to what you desire. Then use it: np /home/<your-home-dir>. It's a very simple script, it doesn't check for existing x flags on files, so be careful if you have a bin directory in your home or, say, ".steam".
Offline
Also read the chmod manpage, it has more abilities than setting numeric permissions.
Eg. it's possible to only alter permissions for the u|ser, the g|roup and o|thers and there's a way to alter the exXec bit depending on the file type.
Then also read http://man.archlinux.org/man/core/man- … mask.1p.en
Simply flattening permissions as in #7 is NOT a goto idea, eg. ssh is gonna be rather picky about access rights.
If you have only altered the permissions of your $HOME (not recursively), just change that back (not recursivly) - otherwise: what exactly have you done?
Offline
the default umask of 022 is applied (so 755 for directories, 644 for files
do you mean the umask from /etc/fstab ?
Offline
See WorMzy's post again and also http://wiki.archlinux.org/title/Umask# … mask_value - the mount option is only relevant to non-posix FS, do keep your $HOME on ntfs or fat??
Offline
my /home is ext4.
Last edited by lo7777799 (2025-05-02 09:06:08)
Offline
In which case the fstab parameters for ntfs, fat etc. are of course irrelevant.
Edit:
If you have only altered the permissions of your $HOME (not recursively), just change that back (not recursivly) - otherwise: what exactly have you done?
Last edited by seth (2025-05-02 14:14:22)
Offline
Pages: 1