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

learn more… | top users | synonyms

7
votes
5answers
17k 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
23 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
35 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. ...
1
vote
1answer
29 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.
0
votes
1answer
87 views

All websites infected with PHP Malware. What to do now? [closed]

Theres around 45 websites hosted on a Ubuntu Linux server here which has been infected with a nunmber of viruses due to bad security on the servers. I believe that a chmod of 777 in various folders ...
17
votes
3answers
15k 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
160 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
8k 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 ...
8
votes
1answer
333 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
968 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
926 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
43 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
36 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 ...
19
votes
5answers
33k views

What is the meaning of “chmod 666”?

I am using Linux. What is the meaning of chmod 666?
0
votes
2answers
54 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 ...
9
votes
2answers
8k 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: ...
0
votes
1answer
133 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 ...
0
votes
1answer
124 views

Cannot change directory into home directory, although permissions are set correct

I guess I need some help from an advanced Unix user... On a Ubuntu System I did something stupid. I typed sudo chmod 774 .* or the like, in a subfolder of my home folder and then I suddenly could not ...
2
votes
3answers
1k views

What does the 3 mean in drwxrwsr-x 3

I'm following directions on configuring Dovecot MDA and the instructions are telling me that /var/mail should have the following permissions: drwxrwsr-x 2 root mail When I ran ls -ld /var/mail the ...
-3
votes
1answer
183 views

lost and important file for python 34

My AVG internet security deleted a file called: C:\Python34\pythonw.exe I now cannot access IDLE or even re-install python 3.4, although I can access the command line. How would you chown that file?
0
votes
2answers
3k views

cannot create directory. permission denied. but i have permission

i'm fairly new to linux, and ran ubuntu the other day. it is running dual boot with windwos 8. now, the problem is, even though i log in as root and give a specific folder ALL PERMISSIONS (#chmod 777 ...
46
votes
4answers
16k 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 ...
0
votes
1answer
31 views

How can I skip mounted directories with chmod?

chown supports a -x option to ignore file system mount points. Is there an equivalent for chmod?
0
votes
2answers
110 views

changing the ownership of a file in linux

I have a file "test" on an Ubuntu system owned by the root. The ls -l option is shown below. $ ls -l test -r--r----- 1 root abacus 373 Nov 12 19:19 test I know that only the owner of a file can ...
0
votes
1answer
72 views

Is it possible to disable chmod/chown from sudoers for these specific directories /usr and /etc?

There has been two occasions where I have accidentally chmod-ized 777 the whole direcotry of /etc and it has forced me to come to the decision that I'd be better off to do fresh installation of OS ...
8
votes
7answers
25k views

Equivalent of chmod to change file permissions in Windows

Is there any Windows equivalent of Linux's chmod to change the permissions of a file?
0
votes
1answer
181 views

I broke SSH by using chmod on an EC2 Instance — How do I correct?

I have been running an Amazon EC2 Instance for a while, and recently accidentally changed permissions/ownership on folders recursively. I can no longer SSH into the instance. I do not recall what the ...
1
vote
2answers
1k views

How to chmod +x a file in Windows, for use in Linux?

I have a file that needs to be executable in Linux, which I'd do by using chmod +x when using Linux. My problem is: this file is compiled in Windows, and it's a pain to have to open my Ubuntu VM to ...
0
votes
0answers
90 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 ...
0
votes
0answers
30 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
0answers
40 views

I am unable to change permissions of files in my home directory(NIS)

I am unable to change permissions of files in my home directory. For example: Here /home/user1 is the home directory of the NIS user which is mounted from netapp filer. user1@localhost ~ $ pwd ...
3
votes
4answers
5k 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 ...
0
votes
1answer
36 views

Granting full rights on all files (owned by su) within certain directory

I got some trouble with a server situation, where i keep some configuration files in a sub-directory of a web project. Using my superuser account, i make changes to these files, which NetBeans commits ...
3
votes
3answers
5k views

“chmod” doesn't want to work

I wrote a /bash script and to execute it I decided to set all the rights, so I tried chmod 777 * //I had 3 text files in the directory, so that's ok Then to check the result I typed ls -l But ...
0
votes
1answer
48 views

How do I do undo chmod /usr/bin

For some reason I was messing around and did chmod -x /usr/bin/* (no idea what I was thinking) Is there a way to fix this, because at the moment nothing is executable
1
vote
1answer
4k views

Recursive write permissions on files and folders: Prestashop installation

I am trying to install Prestashop in my Linux machine. But it says Recursive write permissions on files and folders: ~/config/ ~/cache/ ~/log/ ~/img/ ~/mails/ ~/modules/ ~/themes/default/lang/ ...
0
votes
0answers
56 views

vsftpd and persistent errors

I'm configuring a ftp user using this : useradd mz -d /home/ftp/mz -s /bin/false then check password: passwd mz and setting permissions chmod -R 777 /home/ftp/mz and changing owner chown ...
1
vote
2answers
323 views

chmod 700 -R ~ - is it safe?

I'm thinking of doing 'chmod 700 -R ~'. Can it be dangerous? What can happen what I don't expect? Also, is there any way to keep all files on $HOME to be -rwx------?
0
votes
0answers
1k views

Windows 8 permissions (CHMOD) with XAMPP

While I know that CHMOD is impossible in Windows, I do have a problem with permissions. I'm running XAMPP on Windows 8 Release Preview and I'm trying to install ModenaCam. However, I get an error ...
1
vote
1answer
75 views

Why does 'cd' not work on an entry with 'directory' attribute?

My OS is fedora 20. I act as a root user. under / directory, I input: #ll ... d????????? ? ? ? ? mnt ... #cd mnt bash: cd: mnt: Not a directory #chmod 777 mnt chmod: cannot access 'mnt': No such ...
1
vote
1answer
78 views

Disabling chmod for some users

In Linux system, assume that there is user 'A' (non-root user who has ssh login permission). 'A' owns an executable file "A.out". I want to allow 'A' to read/execute "A.out" However, I don't want ...
1
vote
6answers
153 views

Give execution permission to directories but not to files

I have a directory structure with files and directories and I like to assign permissions so all the files and directories have read-write permissions for the user and read permissions for the group ...
1
vote
1answer
82 views

Linux permissions, mv is denied

I have the following structure (property is in the form user:group, user A belongs to both groups A and B, user B is just in the B group) : + dir1 rwxrwxr-x A:A + dir2 ...
1
vote
1answer
65 views

chown all files of removed user (symlinks)

I migrated my OSX System from one machine to another. Everything works fine, but when I check the files under /usr/local, they now belong to a user 502, not my newly created user (which has the ...
1
vote
2answers
3k views

Can't change permission for bash.bashrc file in Ubuntu

I'm trying to change the permission for my .bashrc file in Ubuntu but don't seem to have permission. I've tried following the example here: Open up publicity.html for reading and writing by anyone. ...
6
votes
4answers
45k views

Can't change permission/ownership/group of external hard drive on Ubuntu

I have an external hard drive connected to my Linux box. I wanted to setup a web server to access files on it, but the permission on all files and directories on the drive are rwx for the owner which ...
0
votes
1answer
26 views

Under what circumstances can I not make a file world readble on linux

I'm trying to set some files world readable sudo chmod 664 *.ogg however the files still have permission -rw-rw---- after the operation. These are phone calls recorded from Asterisk - if that ...
0
votes
1answer
130 views

Unable to retain any root created files and folders after warm reboot in linux

I installed and ran petalinux on zynq board. It runs perfectly fine and boot in around 3 seconds. To boot it this fast I had to do some configuration before compiling the source. The problem that I ...
4
votes
2answers
486 views

How to add +x just for user with chmod?

chmod +x file changes a file from rw-r--r-- to rwxr-x-r-x but really I only wanted rwx-r--r-- is this possible?
0
votes
2answers
394 views

CentOS $chmod a+w /etc/sudoers command not found

I am very new to CentOS and I am trying to edit my sudoers file. First I am told to run the following: $chmod a+w /etc/sudoers and right away I hit an error: bash: a+w: command not found What ...