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

learn more… | top users | synonyms

9
votes
5answers
58k 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
23 views

Change permissions symbolic link Mac OS

How do you change the permissions of a system link on Mac OS ? I tried chmod -h 755 mylink using iTerm2 with zsh, but it didn't work.
386
votes
7answers
268k 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
0answers
21 views

Impact of “chmod g-w,o-w /” on a Linux System

If one is on as root, and runs this: chmod -R g-w,o-w / What are the implications? And what would one have to do to undo the effects? Yes, the dumb user was me. So we fixed it as follows: Add ...
1
vote
0answers
21 views

Logging into new FTP server, but no directories show up

I've tried this with both ProFTPD and SFTP. I'm trying to chroot a user to /var/www/user however when I log in to the FTP server with their account, I get "/var/www/user: No such file or directory". ...
0
votes
0answers
36 views

MSYS2 permissions

In Windows 10, with MSYS2 I set my fstab to: none / cygdrive binary,posix=0,acl,user 0 0 I am unable to set execute permissions with chmod, despite having acl set in the fstab: # echo > foo # ...
1
vote
2answers
7k 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/ ~/...
69
votes
7answers
30k views

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

I'm trying to change 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 (rw-rw--...
0
votes
0answers
24 views

Rsync (-aR) Create a destination subdirectory with same permissions as top folder in source directory?

I'm using rsync to grab some modules within a web platform. I am able to pull things ok, the -aR relative flag works fine, and the structure is correctly replicated into a subfolder called "...
1
vote
3answers
476 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 [...
25
votes
8answers
78k 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
0answers
34 views

File permissions not preserved on external hard drive

I have a brand new 3TB Western Digital "Elements" external (USB) hard drive. When I copy (cp, rsync) stuff across from my laptop file permissions are not preserved. In fact everything (files and ...
0
votes
0answers
20 views

Directory access not permitted

I recently installed the Open Virtual Desktop (Community Edition) on CentOS 6.6. I tried to open the folder created for a particular session. When the session was logged in, the folder could be ...
0
votes
1answer
46 views

Linux chmod: How to allow access to a folder and its subfolders/files

How can I do "chmod 704" to a folder which I want it to allow others to access and download the entire folder including its sub-folders and files? Thanks, Baha
4
votes
2answers
90 views

SUID bit on directories

In Linux there are SUID, SGID, and sticky bits for directory permission. So I am absolutely clear about the sticky and SGID bit on files or folders. What happens if I apply SUID bit on a directory? ...
1
vote
3answers
4k views

sftp chmod recursive

I have logged into a server via sftp via terminal. When I run the command chmod -R 755 ./* I get the error You must supply a numeric argument to the chmod command.. How do I apply a recursive ...
14
votes
6answers
31k 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 ...
0
votes
1answer
129 views

Prevent deletion of folder but let access to everything inside of it

I know there is the +i flag for files and directories, but i have a deeper Problem. Is there a way to prevent a folder from being deleted by an User which should be able to create / access / remove ...
0
votes
1answer
19 views

Why can't Ubuntu read external volume files after I recursively { chmod +r and remove ACL }?

The commands I used are: sudo chmod -RN /volume and sudo chmod -R +r /volume The external volume is a backup of OSX home folders. The above made it only possible to read what contents is in the ...
0
votes
4answers
41 views

On my Pi, chmod +w doesn't behave as usual?

$ ls -al file1 -r--r--r-- 1 pi pi 0 Feb 10 15:18 file1 $ chmod +w file1 $ ls -al file1 -rw-r--r-- 1 pi pi 0 Feb 10 15:18 file1 #only u is updated $ chmod +x file1 $ ls -al file1 -rwxr-xr-x 1 pi pi ...
1
vote
1answer
178 views

how to mount as read-write filesystem and not read-only

So, I'm trying to install gentoo in a virtual machine. I ran into this problem and began researching what the answer might be. The file system is read only. I can't mount it as read-write. I'd rather ...
4
votes
2answers
5k views

icacls is giving access denied on remote file system

I am working on remote drive mounted on my system where i created some file i need to set some permission for that file. I used icacls but its not working. When i am trying to access file permission ...
4
votes
2answers
831 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
688 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 ...
9
votes
3answers
20k 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 archive)....
13
votes
3answers
17k views

“chmod” doesn't 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
0answers
48 views

Killed server with chmod -R u+rwX,go+rX,go-w /

So I was trying to give files in /var/www/html/ 644 (rw-r--r--) permissions and killed the server: chmod -R u+rwX,go+rX,go-w / That changed permissions on all files it could on the entire server as ...
0
votes
0answers
71 views

(ftp client) uploaded file has wrong permissions

I've a ftp server on my linux machine, I've set rights rules to my server: I keep group and owner and chmod it to 775. When I use it at home (192.168.x.x) it's ok, files keep their group and user ...
0
votes
0answers
120 views

SFTP to multiple users access to same directory and take delete permission

I am trying to give permissions to multiple users to access var/www/my.com/folder2, which is owned by www-data. So simply I have a lot of sftp users and everyone only accessing to var/www/my.com/...
1
vote
1answer
5k 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
2answers
4k views

Can't connect Nextetender on Mac OS-X El-Captain

I just upgraded from Yosemite to El Captain but I can't connect Dell SonicWALL NetExtender version 7.5.757. I give this log message: [general error 463] ERROR: Pppd is not setuid-root and the ...
9
votes
4answers
9k views

Git chmod problem: Checkout screws exec bit

Under Ubuntu and Debian the last committed files are getting the execution bit set, when I try a checkout afterwards. It's quite strange and driving me nuts: $ ls -l file -rw-r--r-- ... file # on ...
26
votes
2answers
75k views

How to chown/chmod all files in current directory?

I am trying to change the ownership and permissions of some files (and directories) in the current directory. I tried this: chown username:groupname . ...expecting that it would affect all the ...
6
votes
3answers
8k views

whats the difference between chmod 777 and chmod 7777

I have a professor who insists on always typing chmod 7777, but I was taught that chmod 777 was the proper convention. I tried them out on the command line and chmod 777 something.txt yeilds -...
23
votes
4answers
27k 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.
0
votes
0answers
129 views

Why does chmod g+s not work on my NFS mounts?

I've got some NFS mounts that have directories that I need chmod g+s set so that any files extracted inside of them retain the default GID. For some reason it won't let me change this on the NFS ...
12
votes
3answers
18k 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: ...
24
votes
3answers
171k 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 ...
0
votes
1answer
614 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: -rw-...
0
votes
2answers
59 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
115 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
23 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
38 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
743 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
7k 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
153 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 ...
0
votes
1answer
76 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
40 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 pi@46.108.38.186:...
0
votes
1answer
566 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
75 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 ...