I'm using CentOS on a virtual dedicated server.
When I go in as root, and change the chmod value of a folder it works.
To enforce the following permissions on files in /var/www, can I use the commands chmod u+s and chmod g+s? Do I just run it on the /var/www directory (once the permissions are properly set)?
Permissions:
chown -R root:web /var/www
chmod -R g+rw /var/www
Under what circumstances will chmod fail?
I looked at the man page but it only specifies usage and doesn't go into details about what circumstances it won't work in.
I'd assume chmod will work if:
you're root
you own the target file (and are setting a mundane mode bit i.e. not sticky bit, others)
Can users use chmod to change permissions on a file they have group access for?
I'm running a duel boot/partition machine with Ubuntu 12.04 and Windows 7. On Ubuntu OS, I wanted to change the permissions in one of my directories so could extract files into that directory. In the terminal I entered chmod -R 777 /usr/share/icons which gives the owner, group, global read, write, and execute permissions.
Write a Unix shell script named 'mode' that accepts two or more arguments, a file mode, a command and an optional list of parameters and performs the given command with the optional parameters on all files with that given mode.
For example, mode 644 ls -l should perform the command ls -l on all files in the current directory that have mode 644.
I came up with this code.
I've been trying to wrap my head around chmod/chown (both for those wondering) for hours now with no luck...
All I want is to be allowed to change my files permissions so I can run executables with WINE and delete the virus after it nested in my .Trash-999 folder.
What is the terminal command line to unlock my system? Completely.
pcuser wrote:only 10 seconds? nice..however I still would like someone to explain this if possible because I am still lost. on that link you gave me it said the user/group that apahce is on is not allowed to access those files/folders. How do I change that? the page also said something about chmod, but not I am not sure what to chmod the files to.
The folder /var/www was mounted during init, using:
mount -t vboxsf cuckoo_shared /var/www/ -o uid=1000,gid=1000,rw,dmode=755
Now, all the files belong to my user jdrummond as default.
I kinda screwed up the /etc directory by running:
sudo chmod 417 /etc
Leaving me unable to use sudo:
sudo: can't open /etc/sudoers: permission denied.
sudo: no valid sudoers sources foundm quitting
Ive been trying to fix it via recovery mode but i'm not sure to what mode I should set it.
(I know sudoers is 0440, but this doesnt fix it because /etc is still messed up.)
Oh and for the future