New answers tagged

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 ...


3

+X means to set the execute bit: if the file is a directory or if the current (unmodified) file mode bits have at least one of the execute bits (S_IXUSR, S_IXGRP, or S_IXOTH) set. It shall be ignored if the file is not a directory and none of the execute bits are set in the current file mode bits. Once you've run chmod -R _+x dir, the execute bit is ...


3

Many operations on directories require execute (search) permission in addition to read permission. chmod 666 clears the x bits, causing strange failures of ls and other basic stuff. Reasonable default permissions might be 644 for files and 755 for directories.


0

Well, I figured it out! Most of the functionality in my home directory relied on the group permission, not just my individual user permission. After I changed the group permission to read / write / create + delete files, everything went back to normal :-) Hopefully this helps someone else out there in time!


0

In most systems, the disc files' default privilege before the umask is applied is the same as regular files. (0666)


3

When determining access permissions using Unix-style permissions, the current user is compared with the file's owner, then the group, and the permissions applied are those of the first component which matches. Thus the file's owner has the owner's permissions (and only those), members of the file's group have the group's permissions (and only those), ...


2

Assuming john does not bear uid 0, john would have no permissions, as john is a member of the group, and the permission check would not consider the world bits because of the group match (source: "Advanced Programming in the Unix Environment", chapter 4, section 5, p. 80 in the first edition.) 642 would result in the 4 bits being applied for the same reason. ...


1

The permissions for files (subject to umask) are set in the open call when the file is first created. In fopen, the permissions are set to 0666, but that deals with stream I/O. Depending on the application which creates the files, they may use the low-level open/read/write — or not. Special devices would be created using mknod, again with the ...


2

You seem to have got it pretty well figured out; it is discussed a bit more here.  The one point that you may have missed is that you found the statement in the man page for touch(1) and not creat(2), because (with the possible exception of symbolic links), there are no system-level defaults — each program has its own individual default.  It just so happens ...



Top 50 recent answers are included