chmod (short for change mode) is a Linux / Unix command used to change permissions of files and directories.

learn more… | top users | synonyms

10
votes
3answers
12k views

How can I do a recursive chmod only on directories?

I want to change permissions on a tree on Centos 4 to add execute permissions for all directories recursively from a directory. If I use normal chmod, files other than directories are also modified: ...
17
votes
3answers
108k views

Chmod to allow read and write permissions for directory

I have created directories in root. I am looking for the chmod command to allow all users read and write permissions to a specific directory. I have done chmod 775 for a file but I need this for a ...
2
votes
2answers
11k views

Creating files and directories with a certain owner (user/group) while sudoing

I need to wget something (results in a compressed file in cwd), then I have to extract it, then do some copy/move/modification stuff and perhaps finally execute an script (from the downloaded ...
0
votes
1answer
59 views

How to read ls -l permissions

I've been trying to understand Linux permissions. I know that I could download one file via CyberDuck from a remote Linux machine and the other one I was not able to. Here is the output of ls -l: ...
0
votes
2answers
40 views

used chmod wrongly to mess up copy rights. How to correct

I ran a chmod command like chmod 644 dir/* It seems to have worked for files in this directory, but files in all other sub-directories are now in some limbo state. ls -l dir/sub-dir shows: ...
0
votes
2answers
62 views

Confirmation prompt for chmod, chown

I'm just trying to add a confirmation prompt to a few linux commands like chmod and chown. I've tried to google this but I can't find much information on the topic. While searching I found out ...
1
vote
1answer
15 views

chmod without modding other user perms

I want to chmod a file but I want to do it so it doesn't effect the other "user"/"groups" e.g. giving the root 0 before 741 chmod 0** [filename] after 041 or give the group a 7 before 741 chmod ...
0
votes
1answer
22 views

chmod 777 based on directory

I am wanting to perhaps create a cronjob that will monitor a directory and will do automatically chmod 777 and files that are created inside the directory or a subdirectory of my main directory. Is ...
1
vote
2answers
410 views

Changing access rights of the specific folder for specifeid user

what is the exact analog of the following two commands in linux # chmod -R +a "www-data allow read,delete,write,append,file_inherit,directory_inherit" /path/to/moodledata $ sudo chmod -R ...
4
votes
5answers
6k views

Fixing/Correcting OS X home folder file permissions

Long story short, I managed to muck up the file permissions within my home directory in OS X (Lion). While I'm familiar enough with linux file permissions and more than comfortable changing them, I ...
4
votes
1answer
64 views

What does chmod 7760 <directory> do in CentOS 7 bash?

I typed the command chmod 7760 by accident. I meant to type chmod 770 and now I'm curious what the first command did exactly. After typing chmod 7760 , I typed ls -Al and the directory name was ...
60
votes
7answers
24k views

Using Cygwin in Windows 8, chmod 600 does not work as expected?

I'm trying to change the the permissions to my key file key.pem in Cygwin 1.7.11. It has the permissions flags: -rw-rw---- chmod -c 600 key.pem Reports: mode of 'key.pem' changed from 0660 ...
4
votes
1answer
360 views

OSX how to chmod a mounted AFP folder from NAS

I have mounted a drive from my DLINK DNS 320 Nas onto my Mac Mini 10.9 via AFP. One of the subfolders where I usually store photos (named '2013') is currently showing restricted access permissions, ...
0
votes
1answer
32 views

Converting these chmod commands to cacls?

Perhaps someone could help me. I'd like to convert the following chmod commands to use on Windows 7 but my understanding is lacking. /bin/chmod -R u+w,go-w,a+r somedirectory /bin/chmod a+x ...
1
vote
0answers
24 views

Automatically chmod a+r on files copied into my (OSX FUSE / sshfs mounted) VFS

I have a virtual Linux machine running LAMP. On my MacBook I've mapped ~/remoteFS to this machine's ~/ using OSX FUSE & sshfs. i.e. First I install OSX FUSE. then I do: sshfs ...
285
votes
6answers
187k views

How to chmod all directories except files (recursively)?

How to chmod 755 all directories but no file (recursively) ? Inversely, how to chmod only files (recursively) but no directory ?
0
votes
1answer
105 views

How to correctly set writable the /var/www/ directory of an Ubuntu Linux system?

I am a software developer so I am not so into operating system configuration details and I have the following problem. I have installed a LAMP environment of an Ubuntu Linux system dedicated to the ...
0
votes
0answers
32 views

World writable sudoers, no root password set

I have Kubuntu 14.04 installed on USB flash drive. Yesterday by accident I did chmod 777 /etc/sudoers. Now I can't set it back to 0440, because I get an error something along the lines of 'File is ...
2
votes
0answers
26 views

Why does Linux(and perhaps Unix) set the default chmod to 644? [closed]

The 6 for the owner makes sense, and 4 for groups makes sense. But why can everyone read? It personally seems like an opening for potential misconfiguration.
7
votes
2answers
1k views

Vi can write to file despite file being read-only

The following example show how to create a file with only read permissions. As we can see, when I try to write to this file using the echo command I get, Permission denied. But why, in the case that ...
0
votes
0answers
115 views

DD-WRT: /tmp folder permissions

After making a simple hello world OpenWRT package I installed it to the /tmp folder on the dd-wrt device. The program shows up in ls /tmp but when I try to execute it, it shows me /tmp/helloworld: ...
1
vote
0answers
26 views

Making file's mode 000 on cygwin - does not work

Seems cygwin is unable to cancel a file readability mode, viz.: $ echo "123" > ttt $ cat ttt 123 $ ls -ls ttt 1 -rw-r--r-- 1 Administrator None 4 Mar 22 10:19 ttt $ chmod 000 ttt $ ls -ls ttt ...
2
votes
4answers
3k views

File still unwriteable in /var/www/html after the chmod command

I've got some trouble while trying to install some applications on my linux system. It is said that the files in my /var/www/html/xxx directory, where I put them, is not writeable. The command chmod ...
0
votes
0answers
252 views

chgrp and chmod not working in cygwin (windows 8)

I work in "C:\Users\leyou.ssh" I need to chmod id_rsa to 600 as it's currently 644, but it has no effect. Hence I tried "chgrp Users id_rsa" but it doesn't work neither and the group remains as ...
1
vote
2answers
141 views

sudo chmod o+x but still can't run as regular user

I thought that doing sudo chmod a+x /root/file.to.execute or even sudo chmod 777 /root/file.to.execute should allow me—as a user—to run the program in question. But after doing this I still can’t run ...
1
vote
1answer
4k views

chmod 777 on local server not working

i have a ubuntu 10.10 box on my local network and sshing with my mac what i did is chmod 777 the www directory recursively so that i can use my fav ide to develop on it. i did this sudo chmod 777 ...
0
votes
1answer
129 views

cygwin's chmod behaves as working, but it does not work

My Cygwin installation is behaving strangely: chmod does not work. [09:45 Administrator@DellIns14 ~] > ls -ls /usr/bin/chmod 64K -rwxr-xr-x 1 Administrator None 38K Feb 6 2012 /usr/bin/chmod ...
0
votes
1answer
12 views

tree will not descend into directories

I just unpacked a tar file with a folder in it. I did a tree -F and saw asterisks popping everywhere. All of the files (even png, txt, etc) were marked as executable. So I did what any sensible human ...
0
votes
2answers
82 views

chown not working on ext4 hard drive

I have a new 3TB internal hard drive and after writing some data to it I completely zero'd the drive using DD. I then created a partition table (GPT) in Gparted and created an ext4 partition. All went ...
1
vote
1answer
308 views

chmod throws missing operand on 764, OK on 664

Having set everything in my project to 777 (rwxrwxrwx) for debugging purposes, I wanted to dial down the openness and set the directories (not the files) in the root folder to 664 (rw-rw-r--). To do ...
2
votes
3answers
7k views

Git pulling without root access

On a Ubuntu Server 10.10 box, I seem to require root access to use git pull (in my /var/www directory). error: cannot open .git/FETCH_HEAD: Permission denied. I have tried chmodding 0777 /var/www and ...
-1
votes
1answer
137 views

Can't run chmod on a bin file

I am trying to install the android NDK on OSX 10.10. Even though the file is there it keeps returning "No such file or directory" user$ ls acs git-media npm acs-debug ...
0
votes
1answer
36 views

Make my custom program root

I have a custom program in C, that iterates trough a directory and writes a log file with the contents in my home. However, it cannot acces /var/log/ /etc/ and other root folders. How to change that? ...
0
votes
1answer
59 views

change permissions for only one user in Apache-managed directory

Ok, this may look like it might be an Apache or an Owncloud question, but I think the way I want to try and solve the problem is a more generic one: On a Mythbuntu 14.04 server box, I have Apache ...
0
votes
0answers
19 views

Mounted Share from TerraStation file server - can't change file or directory permissions

I am trying to delete files from the TerraStation share in a subdirectory. These are marked by TS as having permissions issues. Through a terminal window (Mac, OS 10.10, CentOS) I su then cd to ...
8
votes
5answers
22k views

How to reset folder permissions to their default in Ubuntu?

I recently typed the command sudo chmod 777 -R / after that some things like sudo -i are not working normally. So I am wondering if there is any way I could reset the folder permissions to their ...
1
vote
0answers
37 views

Chmod doesn't work for all files

I'm trying to chmod my /var/www folder in Ubuntu, with the command: chmod -R 775 /var/www, and it works for the existing files. However, every time I add a new file, I have to run the command again, ...
2
votes
2answers
271 views

Error writing to USB mounted on Raspberry Pi

I have a Raspberry Pi which I recently bought, and am planning to use it as a torrent box. While setting it up (over SSH) I tried to mount a 8GB SanDisk USB Drive I had connected to it earlier. ...
2
votes
1answer
205 views

What does `chmod u+s directory` do?

chmod g+s directory makes new files inherit the group of the directory. I thought that chmod u+s directory would make them inherit the directory owner, but they don't and I see no other effect.
20
votes
3answers
20k views

How to chmod and chown hidden files in Linux?

How do I recursively execute chmod or chown for hidden files? sudo chmod -R 775 * does not work on hidden files. The same thing goes for sudo chown -R user:group.
5
votes
2answers
171 views

What is this hidden directory doing on my Desktop?

On my Mac I just encountered a hidden directory on my desktop. I don't recall putting it there. When I type ls -la in Terminal on the desktop I get the following: The last folder is what triggered ...
7
votes
3answers
9k views

How to set default permissions for files moved or copied to a directory?

My question is similar to How to set the default file permissions on ALL newly created files in linux - but differs in important ways: I want all files created in (or copied to or moved to) a certain ...
9
votes
1answer
420 views

Why will chmod 0000 directory-name not clear the special bits on the directory?

$ mkdir test $ chmod 0000 test $ ls -la | grep test | awk '{print $1}' d---------. $ chmod 6000 test $ ls -la | grep test | awk '{print $1}' d--S--S---. $ chmod 0000 test $ ls -la | grep test | awk ...
2
votes
3answers
1k views

chmod: Set files to different permissions from directories

Is there away that I can run chmod to set the folders at 0755 and the files at 0644, or do I have to apply 0755 to all folders individually?
2
votes
1answer
1k views

chmod does not change file permissions

I am trying to create an executable "Hello World" ruby file and I copied an existing, working executable "Hello World" ruby file and renamed it, but the new file does not have any executable ...
1
vote
0answers
61 views

Is there anyway you can restrict users from executing a command with another name?

I'm not asking an obvious question here. I would like to elucidate with an example. A user 'bob' is always executing 'chmod 777 /home/bob/impfiles' so that user 'alice' could make changes to the ...
0
votes
1answer
46 views

Shell Command that Combines chmod and chgrp

Is there a combined variant for chmod and chgrp that sets both user and groups permissions in one single system call for each file? This is useful for increasing performance on slow data layers such ...
20
votes
5answers
46k views

What is the meaning of “chmod 666”?

I am using Linux. What is the meaning of chmod 666?
0
votes
2answers
192 views

Change default permissions for new files and folders

Every time I create a new file or folder in Linux, it is accessible for r/w by myself, not the group. I want to change my system setting such that every new file or folder will be automatically ...
0
votes
1answer
147 views

Does “chmod -R 700 directory_1” update directories pointed by softlinks?

Does "chmod -R 700 directory_1" update directories under softlinks? Forexample, there is a softlink under directory_1 folder: "my_softlink". And my_softlink points to a directory_2. Will permissions ...