Hot answers tagged

5

Sure, to demonstrate, as root... touch /tmp/test setfacl -m u:jdoe:--- /tmp/test getfacl /tmp/test su - jdoe cat /tmp/test exit rm /tmp/test It could be done to every file in a directory by default as well: mkdir /var/data/not-for-jdoe setfacl -m u:jdoe:--- /var/data/not-for-jdoe setfacl -d -m u:jdoe:--- /var/data/not-for-jdoe Above, the -m switch is ...


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.


5

Deleting a file isn't a modification of the file, it's a modification of the directory containing the file. If you don't have the rights to modify the directory, you cannot remove the file within that directory.


4

I'm assuming you want to create a directory which other members of your group cannot list, but where you can make files accessible to them anyway... Accessing a directory requires the "execute" permission, listing its contents requires the "read" permission. If you make a directory executable but not readable, users can access files stored within but can't ...


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


3

/root/ is root's home directory. The permissions on /root/ are hopefully 700, preventing anyone but root from traversing the entire directory tree below it. You're being prevented from running the binary as a non-root user by permissions further up the directory tree. Installing anything into /root/ is unusual, you would normally install executable code ...


3

Something like this: vimdiff <(find /home/masi -printf "%P %u:%g %m\n" | sort) <(find /home/masi_backup -printf "%P %u:%g %m\n" | sort) (this gives names without the leading /home/masi or /home/masi_backup, owning user and group, and permissions — the latter weren't mentioned in the question but seem useful, drop %m if you don't want them).


2

If you add this user to the new group recently, note that new groups membership is applied after logging-in again. Command groups gives you available groups in current shell, but groups $(whoami) returns the groups that you will get after re-login. You can also force the sync of the groups using exec newgrp btsync.


2

Create a file ".protected" and do as root chattr +i .protected You can then delete all files except .protected within this directory, thus the directory can't be deleted by any other user.


2

Check the permission on all the files involved, including the directories: ~/VirtualBox VMs, ~/VirtualBox VMs/MyTinyLinux, ~/VirtualBox VMs/MyTinyLinux/rawdiskonusb.vmdk, /dev/disk2. The directories need to be readable and traversable by your user (chmod +rx) and the image file and the raw disk need to be readable and writable (chmod +rw). You'll need to ...


2

Unix permissions allow writing to file if accidentally someone will set group or world writable bit on setuid file, but disallow changing owner and group ids on such files by strangers. So after modification kernel drops setuid/setgid bits from file to ensure there is no malicious code was written to file. root user of course can restore setuid bit, but ...


2

Note that while you could edit the sudoers file (using visudo in a terminal as root), what you probably actually want to do is add yourself to the wheel group. See How to make Fedora user a sudoer? for details, but in short, this group is predefined as having sudo-for-everything privileges and is our standard "admin" group. (If you check the "make user an ...


1

You able to set sudo chmod +x /usr/bin/* It's a little strangely that files in bin are not executable be default. For example in my ubuntu: $ ls -la /usr/bin/ ... rwxr-xr-x 1 root root 14768 апр 15 01:19 zdump -rwxr-xr-x 1 root root 10384 янв 31 02:14 zeisstopnm -rwxr-xr-x 1 root root 206000 фев 24 17:31 zeitgeist-daemon ...


1

I believe there is no way of doing this using just standard UNIX privileges. The problem here is that (as far as I know) a newly created file is always owned by its creator — and if you are able to create the file, you have write privileges to the parent directory, and can therefore delete the file as well. You can use the sticky bit to prevent users from ...


1

Since permissions do not matter, copying with cp -R is fine. The command you're using to compare the two trees compares the file names, ownership and permission. If you don't care about preserving permissions, don't print out the permissions! vimdiff <(cd /Volumes/fat32/ && find . | sort) <(cd /Users/masi/BitTorrentSync/ && find . | ...


1

Depending on the distribution, you might have to add your username to the VirtualBox group. usermod -a -G vboxusers myusername Additionally, according a similar Q&A on askubunt, you might have a corrupt ISO. In your case, I would guess it means a botched conversion to raw disk. Try searching on how to correctly do that procedure and repeat it, in ...


1

d is an abbreviation for default. The default and actual permissions are independent. Run the setfacl command a second time without the d:, then the permissions should work as desired. I assume you want the effect of both commands. The output of getfacl can suggest this conclusion to you, by showing default: expanded showing the original Access Control ...


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


1

Using information from your comment, the solution seems to be to fix the underlying issue rather than answer the question you've actually asked. I use scp to move a locally built .jar from my machine to the home folder on the linux server. I then have to move that .jar from my home folder to a shared folder where the .jar can be executed. To move that ...


1

mount with option allow_other. If you rely on these permissions being enforced, add the option default_permissions.


1

Do you have the correct permissions set on the */school folder? I had the same 403 message recently after reinstalling a folder in /var/www/html after an OS upgrade. It turned out that the premissions on the individual files were ok but on the folder only I myself as owner had read, write and execution permissions. Group and others also needed read and ...


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


1

Generic FUSE options 1) I noticed allow_other wasn't set on the ntfs-3g filesystem mount. The default for FUSE is not to allow access by other users. mhddfs is a FUSE filesystem and so is ntfs-3g (but see next section). 2) When you use allow_other, you also want to consider permissions checking. The default for FUSE is not to check permissions. So just ...



Only top voted, non community-wiki answers of a minimum length are eligible