New answers tagged

6

You would strip all security from your system making it extremely vulnerable. Lots of programs would stop functioning due to insecure permissions. You are technically right it would append those rather than over write so you would keep SGID and SUID permissions. I have an old Ubuntu machine I no longer need so I figured I would test this. After running chmod ...


2

I thin these commands are not the same because you are using + in symbolic representation rather than = , so your observation may be correct but It is better to see the man page for chmod. man chmod ................... SETUID AND SETGID BITS chmod clears the set-group-ID bit of a regular file if the file's group ID does not match the user's ...


6

1 - use a programming language that implements chmod Ruby: ruby -e 'require "fileutils"; FileUtils.chmod 0755, “chmod"' Python: python -c "import os;os.chmod('/bin/chmod', 0755)” Perl: perl -e 'chmod 0755, “chmod”' Node.js: require("fs").chmod("/bin/chmod", 0755); C: $ cat - > restore_chmod.c #include <sys/types.h> #include <sys/...


0

Umount it, and make the mountpoint more permissive. Sometimes this is relevant... maybe it is in your case because using a different mountpoint has different results. Compare the permissions on those 2 directories for more info. Check man ntfs-3g for options, and use them, for example: mount -o fmask=664,dmask=775,uid=1000,gid=1000 /dev/sde1 /home/craig/...


1

Yes, doing it as the root user would allow you to change the permissions on (and owner of) these files and directories. $ cd /backup/dir/somewhere $ sudo chown myname:mygroup myfile $ sudo chmod u+rw myfile ... where myname and mygroup is your username and default group (check you other files in your home directory or use id -n -u (for username) and id -n ...


0

You need to become root (using su or sudo) as only the owner of a file can change its permissions.



Top 50 recent answers are included