Questions tagged [chmod]

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

chmod accepts either human readable notation of the octal bitwise mask. The bitwise mask often has the three digits, specifying (from left to right) permissions for the world, group and the owner of the file. The bits (left to right) are read, write, and execute. For instance,

chmod 740 x.sh

makes x.sh viewable, editable and executable for the current owner. The group can view but not change or execute, and the world has no access. This can be verified with ls -l x.sh:

-rw-r--r-- 1 me 11 2013-01-25 09:53 x.sh

Permission flags can also be specified as letters (r - read, w - write, x - execute), using + or - sign to turn them on or off, for all users. For instance

chmod +r-x x.sh

with make x.sh readable for possible users but no longer executable, even for the owner. The write permission that has not been mentioned in the command, will not be revoked form the owner:

-rw-r--r-- 1 me 11 2013-01-25 09:53 x.sh

Chmod also accepts the forth (actually first) digit that sets (left to right) setUID, setGUI and sticky flags. If not specified, it is assumed 0 (no such flags).

If chmod parameter is less than 3 digits, the first owner and then group permissions are assumed zero. The following example sets (probably in an unexpected way) full permissions for the world and no permissions for the user or group:

chmod 7 x.sh
cat x.sh
cat: x.sh: Permission denied
326 questions
0
votes
1 answer

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 home folders (in Desktop, in Documents) but not the…
0
votes
4 answers

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 0 Feb 10 15:18 file1 #all updated Is this how chmod…
u936293
  • 1,347
-1
votes
1 answer

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 github ti alloy javascripting tishadow android-ndk-r10d-darwin-x86_64.bin n…
Brian
  • 1
-1
votes
1 answer

Linux directory permission inheritance for new files created

ive following folder drwxr-xr-x 7 root root 45056 Nov 25 12:39 data which include sub dirs and files its all 755 , but when i create new file inside these dir its get permission -rw-r--r-- 1 root root 0 Nov 28 2013 new how to make new files create…
-1
votes
1 answer

simple priveleges/chmod setup doesn't work

here is the directory listing: drwxrwSr--. 31 storage storage 4096 Nov 20 23:12 storage id returns uid=501(peter) gid=501(peter) groups=501(peter),504(office),505(www),506(storage),507(media) looks ok? but when I try to enter this this I am getting…
user21886
  • 433
-1
votes
1 answer

Take control of all disks/filesystems automatically in linux (Kali)

I have two mac disks plugged into my Linux Kali and for the life of me I cannot get ownership of them. (LaCie) I don't have this problem in Windows or Mac, I just copy the files. Drag and drop. But no matter what commands chown , chmod , any which…
Graham
  • 1
  • 1
  • 1
-1
votes
2 answers

Did I break sudo?

So I typed sudo chmod 777 -R /usr/bin and now when I try to use sudo, it says, sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set I tried to change the permissions of /usr/bin/sudo using chmod but it says chmod: changing…
Lucy Manzoli
  • 109
  • 6
-1
votes
1 answer

i need help reversing a chmod, chown and 'whoiam' code

I used this code on an app: chmod 600 /Applications/Freedom.app ; chown 'whoami':staff /Applications/Freedom.app Does anyone know how to undo this?
-1
votes
2 answers

How does bash make a file executable?

I know that when I run the command chmod +x filename bash will make my file an executable. What exactly happens to the architecture of the file to change it to an executable? i.e. how does the kernel know that this file is executable? Just trying to…
-3
votes
1 answer

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?
Aweys
  • 11
  • 3
-5
votes
1 answer

Chmod to change permissions for group

Possible Duplicate: Setting permissions for specific user and groups in Linux I have put some users into a group and would like to know how I use chmod to change the access permissions for only the members of that group. Thank you.
user135880
  • 1
  • 1
  • 1
1 2 3
…
21
22