New answers tagged

0

(1) First question: ... as usual, the apache process user www-data is the only member of this group ... What is wrong with this? I see no point in setting the "other" permission to anything apart from 0 (instead of the often recommended 5 for directories and 4 for files) Firstly adding yourself as a system administrator/developer as a member of the ...


1

I assume AIX has a perl of some sort. perl -e 'printf "%03o\n", (stat( $ARGV[0] ))[2] & 07777' /etc/hosts The stat function returns all sorts of exciting metadata about the chosen file. Here, I'm just using the third element ([2] counting from zero), which is mostly permissions. The printf "%03o\n" outputs the value of the permissions in octal (eg ...


1

This is more Linux specific and obscure (will need ACL tools installed) but the getfacl command will show output similar to this even if there are no ACLs set on a file: [root@mymachine ~#] getfacl my_file.txt #file: my_file.txt #owner: root #group: root user::rw- group::r-- other::r--


3

Besides stat (Linux-specific), there are tools which allow you to do this as a side effect. The tar program, for example can do this: tar cf - filename | tar tvf - For example $ tar cf - foo |tar tvf - rwxr-xr-x 1021/1021 18 Jan 13 21:40 2016 foo Using the special "-" like that is reasonably portable (it works with AIX, HPUX, Solaris, Linux and ...


0

You can use stat, as in stat <filename>.


5

You are missing the commas: tina,lu ALL = /bin/chmod, /bin/chown, /bin/chgrp Without the commas you are giving the right to execute /bin/chmod /bin/chown /bin/chgrp which of course doesn't make sense, but is syntactically valid as far as visudo knows.


0

From info '(coreutils)Numeric Modes': Special mode bits: 1000 Restricted deletion flag or sticky bit 2000 Set group ID on execution 4000 Set user ID on execution


1

6754 sets the world, group, user, and UID bits on a file or directore, right-to-left. For the UID bits, they correspond to --s--s--s in a ls -l listing. That chmod is setting bits as follows: 6 --s--s--- 7 rwx 5 r-x 4 r-- Since, by this metric, s overrides x, when these permissions are "summed up", you get rwsr-sr--.


0

You can use the octal forms and do the calculations by hand. With a POSIX shell: dir_perms=$(printf '%#o' "$((0777 - $(umask)))") non_dir_perms=$(printf '%#o' "$((dir_perms & 0666))") find . -type d ! -perms "$dir_perms" -o ! -type d ! -perms "$non_dir_perms" The output format of umask alone is not specified by POSIX but in practice, will all shells, ...


1

Why don't you try this one : find . -user trolkura ! -perm -u+rw This means: look for files starting in present directory, owned by trolkura, where the permissions for group and other can be anything (- in front of permission string) and the users permissions are only: rw


1

try: #!/bin/bash while true; do for user in $(ls /home); do chgrp www-data /home/${user}/private/FILE.TXT done sleep 10 done The infinite loop is for bypassing the cron limitation of 1 minute to repeat a job. make it executable: chmod +x /PATH/TO/owner.sh And just run it without a cronjob. Also if you just want to react to the ...



Top 50 recent answers are included