chmod is used to change the commonly used read, write, and execute permissions on files. It can change these permission bits for the file owner, the file's group owner, and everyone else. It can also change the more esoteric ‘permissions’ (attributes, reall) like set-user-ID, set-group-ID, and ...

learn more… | top users | synonyms

101
votes
6answers
6k views

How to chmod without /usr/bin/chmod?

Today I was told a tale by a Unix trainer, a tale where the root password got leaked to the students, and one of the fellas removed the execute permission from /usr/bin/chmod itself. How do you ...
2
votes
3answers
204 views

Safer way for granting permissions for self user?

I know sometimes we can do chmod 777 so we have a directory at our complete reach for accessing, reading and writing. But usually I prefer to do a sudo chown {myusername} {directory}. Obviously, the ...
2
votes
3answers
305 views

'setfacl' permissions don't apply to directories created by git clone?

Here's how I am setting permissions for my website's root directory i.e. ~/public_html, where the files that my website serves are placed: sudo chgrp -R www-data ~/public_html chmod g+s ~/public_html ...
0
votes
3answers
336 views

Directory appears as file?

So we copied some photos in a directory across to a NTFS partition last night, and they were viewable from ubuntu. Today the directory is not accessible from Windows, and when we booted back into ...
5
votes
4answers
894 views

chmod recursive permission on thousands of files

This is a more general question about 'chmoding' recursively. I have this script which at some point needs to change the permissions recursively in a folder which has a few hundred thousand files. ...
0
votes
1answer
32 views

how to display I/O file on shell [closed]

I am writing shell script and I need to display my output at the same time however it doesn't work with 2> somefile.txt and if I do | tee -a somefilel it will not overwrite which I need to . <> ...
1
vote
1answer
228 views

Permission error to access mounted directory in localhost

OK, I formatted my flash to ext4 file system, changed all the permissions to 777 and mounted it to /var/www/html/web. Now, when i access localhost/web it gives the following error: "You don't have ...
1
vote
1answer
154 views

Changed file access to read only but I can still write to the file. Why?

I am running a small embedded system built using buildroot. I have come across this strange behaviour when trying to set up my file permissions on the target device. To illustrate what confuses me I ...
28
votes
4answers
4k views

How to recover from a chmod -R 000 /bin?

And now I am unable to chmod it back.. or use any of my other system programs. Luckily this is on a VM I've been toying with, but is there any way to resolve this? The system is Ubuntu Server 12.10. ...
0
votes
1answer
72 views

Removing access privileges to backup while maintaining current setup

I have a giant directory, and I am dealing with a backup. I would like to store this backup in as safe of a way as possible. One of the ways of doing that is removing rwx privileges through chmod. ...
1
vote
1answer
893 views

Safe to change owner of OS X system folders?

I'm trying to get Homebrew to work. That program's diagnosis tool gives me these suggestions: You should probably chown /usr/local/etc ... You should probably chown them: ...
2
votes
2answers
2k views

Unable to change permissions of file system root

When I write ls -la the output is : tusharmakkar08-Satellite-C660 tusharmakkar08 # ls -la total 88 drwxr-x---+ 10 root root 4096 Apr 18 19:43 . drwxr-xr-x 4 root root 4096 Mar 18 17:35 .. ...
1
vote
1answer
122 views

chmod allowing write when I am not setting it

I've got a perl script which systematically changes permissions. The first thing the script does is remove all permissions. It does this by calling chmod(from perl). I did this as I found the set guid ...
3
votes
2answers
86 views

How can a user restrict their own group rights without being root?

How can I change my user rights from rwx to r-x at the group level? I'm trying to ensure that I cannot touch any data belonging to other users when I am developing and debugging my scripts. Once I've ...
1
vote
3answers
989 views

find . .[^.]* -type f -print0 | xargs -0 sudo chmod 664; does not work

I am using this command to set permissions for files recursively clime@vm6879 /srv/www-php/steeltrading $ find . .[^.]* -type f -print0 | xargs -0 sudo chmod 664 But after executing that command ...
1
vote
1answer
330 views

chmod and chown not working in sudo called script

Based on this Serverfault question, my git user has permission in sudoers to run a wrapper script to move files into my webroot with git. Everything is working fine except for the chmod and chown ...
2
votes
7answers
3k views

Convert ls -l output format to chmod format

Say I have the following output from ls -l: drwxr-xr-x 2 root root 4096 Apr 7 17:21 foo How can I automatically convert this to the format used by chmod? For example: $ echo drwxr-xr-x | ...
0
votes
2answers
165 views

Files created by 'make' aren't getting executable permissions by default

I'm trying to build a project, and when I use the command make, I get the following errors: /bin/sh: line 4: .deps/ipset_bitmap_ipmac.Tpo: Permission denied make[2]: *** [ipset_bitmap_ipmac.lo] Error ...
1
vote
1answer
129 views

Able to delete file without permission [duplicate]

I've been experimenting with file permissions and ownership lately, and I tried this: touch a sudo chown root:root a sudo chmod 000 a I can't read, write, or execute the file, but I can still ...
1
vote
2answers
990 views

Find all directories, in which user has access to search and echo this directories in shell

I need to find all directories, in which user has access to search(command find) and echo this directories in shell. USER is read from ksh. for example: read user I know, if user want to use find ...
-1
votes
1answer
95 views

Why is ./filename required to run executable script? [duplicate]

After creating a Python script file, test.py, in my home directory, and running chmod +x test.py to make it executable, and placing #!usr/bin/env as the file header, I expected to be able to run the ...
2
votes
1answer
4k views

script failing with “chmod: … Operation not permitted”

A script of mine works fine when I run it, but fails when run by a different user, with an error of the form chmod: changing permissions of `/A/B/C/D/E': Operation not permitted (Here /A/B/C/D/E is ...
1
vote
2answers
614 views

Executable located in location A how to run it in location B?

So, I've an executable in my debian server and this executable located in /home/human/ExecuteIt, still i cant figure it out how to run my executable in another location. In my case it is ...
1
vote
2answers
388 views

How to make a path world-readable?

To make some item X world-readable, it is not enough for it to have the right permissions: each component of the absolute path leading to it must also have the right permissions. (My understanding, ...
1
vote
2answers
533 views

chmod wont work - no error message

Everytime I try to change the permissions of a file with chmod on my Ubuntu with a command like chmod 744 /media/DATEN/Dokumente/Coding/Python/DirFileFuncts.py it doesnt work. I tried octal and =rwx ...
1
vote
1answer
868 views

Allow all group members to create directories and files

There are 2 users sftp_user apache Both users belong to the updaters group as well as other groups. New directories and files are created in the /updates/ directory. drwxrwsr-x 8 sftp updaters ...
1
vote
0answers
136 views

External HDD read/write permission changing from a cron job

So, I run an overnight python script that runs a backup of our web data in the /var/www directory, then moves the backups to an external HDD in /media. The script in scheduled in the sudo crontab ...
3
votes
2answers
4k views

Why does “chmod 1777” and “chmod 3777” both set the sticky bit?

To set the sticky bit on a directory, why do the commands chmod 1777 and chmod 3777 both work?
1
vote
1answer
93 views

Securely running LAMP under a specific user

I'm setting up a sandbox type of server that will be used by a couple users as a development environment and knowledge base. The server will have a web frontend so I've installed Apache, MySQL and ...
2
votes
1answer
254 views

What does it mean if a directory has only x (executable) permission for certain user/group?

I stumbled across the directory /etc/ssl/private on Ubuntu (12.04), it has following permission: drwx--x--- 2 root ssl-cert 4096 7月 8 2012 private/ I wonder what does this mean for group ...
3
votes
1answer
151 views

Change who is able to chmod

Is there a way to change who can chmod (change the permissions of) a particular file? It is only the owner of the file (without sudo-ing it), if my experimentation has been correct? But what I want ...
4
votes
1answer
445 views

Clear setuid permission using numeric mode

On an Ubuntu Linux I have a directory with the setuid bit set (drwsr-xr-x) which I want to unset. Neither chmod 755 nor chmod 0755 nor chmod 00755 (I though maybe the first 0 is interpreted as just ...
2
votes
1answer
339 views

Hide parent directory but allow to view dir

I would like the following result on my UNIX system: ls -l /users/test -> permission denied, or any other way so I can't see the content of it. ls -l /users/test/testdir/ -> shows all files in the ...
2
votes
1answer
4k views

Why can I not chmod a file?

[nathanb@ka /x/sim/nathanb/nbsim1] ls -al ,nvram -rw-r--r-- 1 root root 2097152 Jul 5 2011 ,nvram [nathanb@ka /x/sim/nathanb/nbsim1] sudo chmod a+w ,nvram chmod: changing permissions of ...
5
votes
1answer
2k views

what is the difference between “chmod 775” and “chmod 2755”?

Question What is the difference between "chmod 775" and "chmod 2755" ?
6
votes
4answers
3k views

When does chmod fail?

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: ...
3
votes
1answer
169 views

How to create a folder which will change its contents’ ownership to what the folder has?

In a GNU/Linux OS there is no way to change ownership of a file until you are root. But what if I want to hide my system’s username e.g. before sending a file to someone, because some things like tar ...
0
votes
1answer
233 views

Unable to change file permissions [duplicate]

Possible Duplicate: No effect of umask and chmod on mounted drives I am not able to change file permissions using chmod from the user who owns the file as well as from root. I am using ...
2
votes
4answers
3k views

How to make executable of all files excluding a few file types?

I have a folder containing many C source file and the same number of its compiled output files. I set executable bit to all this files but for some reason it was lost, making them not executable. (I ...
2
votes
4answers
8k views

How to permanently change the file/directory permission [closed]

How do I change the permission of file/directories such that I am able to create, edit, delete files/directories anywhere in my system? Currently I am using Ubuntu 12.04. I tried sudo chmod 777 -r ...
14
votes
2answers
8k views

Get the chmod numerical value for a file

In FreeBSD and also in Linux, how can I get the numerical chmod value of a file? For example, 644 instead of -rw-r--r--? I need an automatic way for a Bash script.
2
votes
3answers
161 views

User with read access to /home

Pardon my ignorance but I can't seem to come up with a solution to this one. I'd like to create a user that has read access to every user's home catalog located in /home. Do I need acl's for this or ...
1
vote
1answer
449 views

External drive chmod does nothing

Why is it that I can do chmod on my files when they are on my laptops hard drive, but when i make files on my external drive, i can't change their access rights. I do: chmod 755 somefile, and on my ...
2
votes
3answers
2k views

Change Folder Permissions

I started off with changing to the folder I want to change permissions for, and that is the opt folder. $ cd /opt/ test@testVM:/opt$ So I tried changing the permissions for this folder now using: ...
3
votes
1answer
899 views

Giving SSH users read-only access to a directory

I'm running Fedora 17 and I want to give several users access to files on my secondary hard drives on /run/media/haukur/. This is what I initially did: chmod -R 755 /run/media/ But every time I ...
5
votes
2answers
283 views

Is it possible to represent the +X symbolic permission with an octal value?

Is it possible to represent the +X symbolic permission with an octal value? The chmod(1) man page says: execute/search only if the file is a directory or already has execute permission for some ...
2
votes
2answers
5k views

Find web server group? Permissions problem

I'm trying to make Wordpress work. I currently have this error message: Could not create directory. /var/www/html/wp-content/upgrade/theme_name when trying to upload a theme. This is the ...
1
vote
0answers
596 views

Changing file permissions problem [closed]

A few hours earlier I bought a beaglebone (Ångström installed) and now I am trying to add nameserver 8.8.8.8 (google DNS) to /etc/resolv.conf. However when I open it with vim and try to add my ...
5
votes
2answers
515 views

vim: create file with +x bit

Is there any way to set +x bit on script while creating? For example I run: vim -some_option_to_make_file_executable script.sh and after saving I can run file without any additional movings. ps. ...
2
votes
2answers
438 views

execute bit on directories, but not files [duplicate]

Possible Duplicate: How to apply recursively chmod directories without affecting files? What is the command to apply execute permission for directories (for traversal), but leave the ...