New answers tagged

0

(Avoiding covering what the others have said...) Can you start a container or virtual machine using the external disk? In that case, you could potentially have root on the VM/CT even if you don't on the host.


0

If you used rsync, possibly including --numeric-ids to preserve numeric ids, then things should just be right already. If you want to verify it, try dumping the permissions using stat, eg. find . -exec stat -c "%n %a %A" {} + | sort > oldpermissions.txt and then the same on the other machine, then you can diff the files to compare.


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


0

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 the creator can always delete his files. You can use the sticky bit to prevent users from deleting other users files, and you can use the SETGID bit on the directory to change the ...


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.


0

To find world writable directories, you can use find / -xdev -type d \( -perm -0002 -a ! -perm -1000 \) -print For files change type to f For symlinks type to l To set sticky bit: find / -xdev -type d \( -perm -0002 -a ! -perm -1000 \) -print0| xargs -0 chmod +t


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.


0

I too had this occurrence with pure-ftpd today, on a CentOS server that had been previously updated by a cPanel update. chmod and chown of files were fine, though FTP refused to write specific existing files although creating new files wasn't a problem. I restarted the FTP service, and lo and behold it works again.


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


0

Assuming you are meaning groups a user is member (which affect what the user could do in a system), you can use the following comand: id username


0

From the description, it seems that TeamCity is ignoring the umask. Perhaps it sets the umask in its service script (which was not mentioned in the question). If so, you could modify the script. If not, since it's apparently a closed-source application and in Java, your ability to thwart that is limited. You could make a cron job (running once per ...


0

No, it is not safe: the permissions in /usr/lib are chosen for two reasons: guarding against accidental modification of the system programs, and providing privileged access to various features of the system, e.g., using setuid/setgid programs. You can see the latter using find /usr/lib -type f -perm /7000 to search for any program using setuid (4000) ...


0

Manually create wp-config.php file and past the code which looks like this and re-install the same it will work. <?php /** * The base configuration for WordPress * * The wp-config.php creation script uses this file during the * installation. You don't have to use the web site, you can * copy this file to "wp-config.php" and fill in the values. * * ...


0

A lot of editors, like vi, create a new file when they save changes and rename the old file, adding a suffix like ~. Do... ls -l filename* The old file may have the SETUID/SETGID. Update Just realized there's a reason I've never used setuid/setgid in scripting... As @siblynx pointed out, Linux ignores SETUID and SETGID on shell scripts.


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


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


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


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


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


-1

For Fedora23 run the commands: setsebool -P ftpd_anon_write 1 setsebool -P ftpd_full_access 1 It worked for me.


-1

Open the terminal and type the following Command : sudo chown -R $user:$group ./manifest.json


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

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


0

Please understand that my answer below is not an actual solution but a workaround, as it removes a security enforcement around httpd and the effects of this action can not be predicted. Although, until you figure out what a good and permanent solution is, it works. as root user on your server, execute the commands below setenforce 0 service httpd start ...


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


0

You mention that you're using scp inside your script to download packages. Your problem is with that bit. The issue is that, when you run ssh in this form: ssh user@host command ... there is no pseudo terminal allocated to the script that is running. scp tries to prompt for a password, but it needs a pseudo terminal for that, so without one, you get the ...


-3

Try this: ssh root@hostb 'bash -s' < local-script.sh


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


-2

setfacl is a command from the deprecated because withdrawn in 1997 POSIX ACL draft proposal that was never standardized. setfacl cannot do this. If you have a modern OS that supports NFSv4/NTFS ACLs, you can do this. See e.g. http://schillix.sourceforge.net/man/man1/chmod.1.html Check the examples starting at page 19. This is for Solaris, but AIX and OSX ...


0

Database corruption. Occam's Razor prevails. I moved backups to a new server and updated the db location/apparmor config. I cringed as I restarted everything. I'd spent hours convincing myself AppArmor was a cavernously complex and difficult beast, but my reticence was completely without cause--it worked perfectly on the first try. Amazing how it just ...


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


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


0

It turns out the .AppleDouble files are at fault. When I ls -la and look at my .AppleDouble file in the directory in question: drwxrwxrw- 2 admin admin 28672 May 5 15:13 .AppleDouble The issue is the executable bit under the other permissions. Netatalk users need the execute bit set to use the files inside the folder. This is why the group and ...


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


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.



Top 50 recent answers are included