Tag Info

New answers tagged

0

find your user's UID id -u username find your user's GID id -g username in /etc/fstab none /home/rkmax/myapp/cache tmpfs defaults,mode=0775,uid=998,gid=999 0 0 resources http://askubuntu.com/questions/207180/changing-permissions-in-fstab-in-order-to-allow-writing-in-windows-ntfs-partitio https://kb.iu.edu/d/adwf


4

chgrp is to "change the group ownership of a file or directory". Thus, you can't change user ownership with that command (use chown instead, which can change user and group ownership) If your folder fruit is in 777 mode, obviously, anybody can create a sub-folder inside it. This sub-folder will be owned by the user who created it, so in your case, the ...


3

The command chown needs root permission when transferring ownership to other users. chgrp is irrelevant since it only affects the group, not the user. You can't obligate someone to take a file from you if he doesn't want. If you are a root or with root permissions then you are the commander and you can do whatever you want. Instead as a workaround, you can ...


3

I would gate access to the filesystem through a directory that contains the mount point. As root: mkdir -p /media/group1only/workspace chgrp group1 /media/group1only chmod 750 /media/group1only This is full access to root and read+execute access for members of group1. Don't give them write access here, since if they accidentally rename the workspace ...


1

For example, assuming the filesystem on the disk supports ACL's, and using the hypothetical user, myusername, and the hypothetical group for accessing the disk, diskusers, something like the following could be done. $ indicated a command executed as a regular user; # indicates a command executed as the user, root. Create a group to which a user may belong ...


2

If the filesystem type is one that doesn't have permissions, such as FAT, you can add umask, gid and uid to the fstab options. For example: /dev/sdb1 /media/workspace auto defaults,uid=1000,gid=1000,umask=022 0 1 uid=1000 is the user id. gid=1000 is the group id. umask=022 this will set permissions so that the owner has read, write, execute. Group and ...


1

Had the same problem, and your answer pointed me in the right direction. I found a different solution which does not require editing the apparmor configuration. Instead of using a symlink to redirect access to /home, use the bind option on mount. I added the following line to /etc/fstab: /elsewhere/home /home none bind Once you do this, apparmor won't ...


2

Why is this happening: Probably because the permissions (prior to you changing them with "chmod g+rwxs") didn't allow for the group to modify the file. eg. your group only had read permissions, and the (o)ther group didn't have write permissions either... What does "g+rwxs" mean: For the (g)roup add (+) (r)ead, (w)rite, e(x)ecute, (s)UID permissions (as ...


0

With a little digging I was able to resolve the problem. The domain was running PHP as Apache module. When I switched it back to FastCGI, I was able to restore the user permissions to ~username~:psaserv. After that FTP and web services work fine.


-1

You can try to use sudo su And after that you can try /etc/init.d/sphinxsearch start If this won't work you should comment on me


0

You can do... find / ! -type d -exec tee -a {} + </dev/null ...for a list of all files to which the user cannot write as written to stderr in the form... "tee: cannot access %s\n", <pathname>" ...or similar. See the comments below for notes on the issues this approach might have, and the explanation below for why it might work. More sanely, ...


1

The approach depends upon what you are really testing. Do you want to ensure write access is possible? Do you want to ensure lack of write access? This is because there are so many ways to arrive at 2) and Stéphane's answer covers these well (immutable is one to remember), and recall that there are physical means as well, such as unmounting the drive or ...


15

TL;DR find / ! -type l -print0 | sudo -u "$user" perl -Mfiletest=access -l -0ne 'print if -w' You need to ask the system if the user has write permission. The only reliable way is to switch the effective uid, effective gid and supplementation gids to that of the user and use the access(W_OK) system call (even that has some limitations on some ...


2

Perhaps like this: #! /bin/bash writable() { local uid="$1" local gids="$2" local ids local perms ids=($( stat -L -c '%u %g %a' -- "$3" )) perms="0${ids[2]}" if [[ ${ids[0]} -eq $uid ]]; then return $(( ( perms & 0200 ) == 0 )) elif [[ $gids =~ (^|[[:space:]])"${ids[1]}"($|[[:space:]]) ]]; then return ...


3

You can combine options with the find command, so it will find out the files with specified mode and owner. For instance: $ find / \( -group staff -o -group users \) -and -perm -g+w The above command will list all entries which belong to the group "staff" or "users" and have write permission for that group. You should also check for entries which are ...


1

The umask set in your session does not affect cron. (In fact, each session could have a different umask.) You would need to set the umask at the beginning of your script executed by cron.


3

Incorrect POSIX permissions It means you don't have the execute permission bit set for script.sh. When running bash script.sh, you only need read permission for script.sh. See What is the difference between running “bash script.sh” and “./script.sh”? for more info. You can verify this by running ls -l script.sh. You may not even need to start a new Bash ...


0

For owner/group, it depends on who does the copy, and how. a regular user: will alway be the owner of the copies by all commands root user too, with cp (except with the --preserve option) "preserve" will be the default for root with tar


10

To add Eric's answer (don't have rep to comment), permissions are not stored in file but file's inode (filesystem's pointer to the file's physical location on disk) as metadata along with owner and timestamps. This means that copying file to non-POSIX filesystem like NTFS or FAT will drop the permission and owner data. File owner and group is just a pair of ...


4

That would depend on how you copy it. If you put it in a tar ball and copied that, then untarred it, tar will perserve permissions. If you use rsync it will also, depending on flags, perserve permissions. Those applications are responsible for the permissions. If you were to scp it permissions would not be preserved. The command doing the copying is ...


1

I'm using a udev rule as follows, to give members of group leds access to all LEDs: SUBSYSTEM=="leds", ACTION=="add|change", RUN+="/bin/chgrp -R leds /sys%p", RUN+="/bin/chmod -R g=u /sys%p" Note the ACTION=="change" is needed to handle dynamically created attributes. For example, if the LED's trigger is set to "timer" (echo timer > trigger), then ...


0

I have seen similar issue with one of my application and it was due to selinux in enforcing state. Change : /etc/selinux/config from SELINUX=enforcing ## or permissive to SELINUX=disabled This should fix it. http://sysadminupdates.com/blog/2015/05/11/so-cannot-open-shared-object-file-permission-denied/


1

find /some/dir -type f -perm -020 -ls This works for both GNU and BSD find(1).


2

You can use find with the -perm predicate. From man find (POSIX): -perm [-]mode The mode argument is used to represent file mode bits. It shall be identical in format to the symbolic_mode operand described in chmod() , and shall be interpreted as follows. To start, a template shall be assumed with all file mode bits cleared. ...


0

If the problem is due to the drives moving around putting something like UUID="0ECA6DA1246D89E4" /media/scratch ntfs auto,rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 in /etc/fstab should do the trick. Before you edit it, make a backup Just create /media/scratch (or whatever you want to call it - it ...


0

If you get caught using this... #!/bin/bash # Did user supply an argument (path to folder?) if [ "${1}" == "" ] ; then echo "Directory path required as argument" && exit 1 fi # Was the arg a valid directory? if [ ! -d "${1}" ] ; then echo "Directory argument was invalid" && exit 1 fi # Re assign variable dir="${1}" # Get a list of ...


1

Don't give that user root access as pointed out by Mat. Instead, give them write permission to the relevant directory hierarchy. Use ps as dr01 mentioned to find the user. If the webserver runs in a multi-user environment with php wrappers, that won't necessarily be the same user under which Wordpress runs, though. In such cases you could run a script in ...


1

The Wordpress user is the user running the webserver (apache, apache2, httpd, etc). Do a ps -ef | grep apache or ps -ef | grep http .


0

I had a similar problem where I had the following configuration which used to work with Ubuntu 10, but stopped working with Ubuntu 14 (Apache 2.4): <Directory /var/www/vhosts/example.com/httpdocs> Options +FollowSymLinks </Directory> Switching to this sorted the problem (even though the web server user wasn't able to directly access the ...


4

The problem was the permissions for / (the root directory) and the clue for finding that was this line from your strace output: access("/", R_OK|X_OK) = -1 EACCES (Permission denied) You were missing group read permission settings for /. But because you still had x (execute) permission, which allows you to traverse a directory, you could ...


0

Assuming the application runs with it's own account, which has it's own group: chown root:app_group apptmpdir && chmod 770 apptmpdir (or whatever permissions it needs) Only the owner of a file/dir, or root, is allowed to change permissions. Thus, by making root own it, the application won't be able to change the permissions.


0

I consider it an ugly solution, but yes, you can block any file or inode changes as well as prevent a file or directory being moved by setting it "immutable": chattr +i [file] Occasionally useful, but it can cause confusion down the line when you've forgotten what you did, and nothing you seem to do can modify it.


1

Wildcards with sudo commands are a bit dicey. They can appear to give you security without actually doing so. To sudo, the * does not mean "any files under this directory" as it does in the shell. Rather, it means "any additional options" and must stand alone. Unfortunatley, you cannot in sudo restrict part of the arguments, and further, it wouldn't be ...


1

The permissions are stored in file system metadata. NTFS and ext3/4 file systems differ substantially in how they store metadata. One solution would be to create a tar file of the source directory (with or without compression), writing the resulting file to the NTFS file system. When the content of the tar archive is extracted to a ext3/4 file system the ...


1

Depending on what files you want, you can create a new group (/etc/group) and make the file writable (and the directory containing it if you want the user to create new files) by that group (e.g., chgrp <groupname> <file>; chmod g+w <file>


0

It's a security policy of the modern Samba. Fix by adding this line to your /etc/samba/smb.conf: acl allow execute always = True Source: Samba's Wiki.


1

Either the filesystem is doesn't support setuid executables (because it's mounted with the nosuid option, or because it's a FUSE filesystem mounted by a non-root user), or there is a security framework such as SELinux or AppArmor that prevents setuid here (I don't think Ubuntu sets up anything like this though). That, or you didn't actually run these ...


1

You have to use commands su or sudo. Just adding user to group wheel or adding in sudoers is not enough. The su command switches to the root user – when you execute it with no additional options. You will have to enter the root account’s password. This isn’t all the su command does. You can use it to switch to any user account. If you execute the su john, ...


0

chmod u+s /usr/bin/growisofs solves this problem. But it's a good example of the "wrong way to do this" since it breaks the security afforded through sudo. SetUID growisofs presents an even worse security problem than carefully configuring sudo and it's all of no value for a personal desktop system, IMO.


1

One thing to be aware, is that STIG locks down /tmp with noexec. If you already spent some time on the box, it's possible that you won't be able to execute the files out of that folder. Try another location for download/install. Also, run your installer as SUDO


0

This could happen because you'd not have the permission to the "Trash" folder for that particular partition. Every partition has a hidden folder by the name .trash-### (where the hashes denote some number). Perhaps you don't have the permission for that folder. Try changing permissions of that folder.


0

Note that to make the command sudo adduser $USER vboxsf work, you'll need to log off and log in again. Otherwise the new group isn't loaded. You can exit a shell session using exit or by pressing Ctrl + D. A reboot will work too.


9

You need write permission in the parent direct ory to delete anything from it. In your case this is /home, and as only root has write permissions here only root can delete items from it.


0

if you have a systemd service on CentOs7 you need to stop the service and enable it again to have it fixed systemctl stop httpd vi /usr/lib/systemd/system/httpd.service # add this [Service] UMask=0002 # safe the file with esc ZZ # enable and start apache again systemctl enable httpd systemctl start httpd Then the funny part is that i have chmod 774 ...


2

You said you wanted to grant read and write permissions to all subdirectories and files under: /home/user/workspace/MinimalDbaseExample ... right? Octal 0777 permissions grant rwxrwxrwx symbolically. Octal 0755 permissions grant rwxr-xr-x symbolically. Octal 0666 permissions grant rw-rw-rw- symbolically. To set read/write/execute permissions to the ...


6

This is not an answer, rather a collection of links and thoughts in case someone else would like to study as well. Because this is quite an interesting thing. Related answer on Unix&Linux mentioning it is (or was, can't test with vanilla kernel right now) possible to dump read only binaries this way. Grsecurity was trying to fix this config option and ...


1

Lets add some Debugging Info, like so: $f = fopen('mmascript.m', 'w'); echo "fopen complete." fwrite($f, "#!/Applications/mma/Contents/MacOS/MathematicaScript -script\n"); echo "fwrite 1 complete." fwrite($f, 'Print[100]'); echo "fwrite 2 complete. fclose($f); echo "close complete." chmod('mmascript.m', 0777); echo "Permissions Successfully Changed." ...


1

The FAT formatting won't allow you to set any permissions. There is no way to change that since FAT can't store that kind of meta-data. (Well, actually, from Linux side, you can specify permissions while mounting the FAT device, but the permissions will be the same for all that device and I think you can't change the mount options of your router) NTFS ...



Top 50 recent answers are included