Questions tagged [chmod]

chmod is a linux/unix command. It stands for "change mode". This command is used change the permissions of directories and files.

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
1322 questions
0
votes
2 answers

Using PHP move_uploaded_file function permission denied

I've been stuck on this code for days as I am hitting this error when I upload a file to the server. Its a windows server running on Apache Tried various solutions but still receiving the error. I tried changing full permissions to everyone on that…
0
votes
1 answer

Getting Permission To Write a New File to a Server in PHP

Solved I figured out who the current user was using PHP and managed to set the new directories' owner to be the user the PHP scripts are executed from. However, this was still causing issues as some other commands (used to determine who the current…
Donald Whyte
  • 195
  • 2
  • 9
0
votes
1 answer

Can't install Magento due to permissions, what am I doing wrong?

I've run the following commands on my Magento directory on Ubuntu Server. chmod 0777 var/.htaccess chmod 0777 var chmod 0777 app/etc chmod -R 0777 media However, now the Magento installer is still complaining with: Path "/var/www/store/var/package"…
Anonymous
  • 6,181
  • 7
  • 45
  • 72
0
votes
2 answers

Allowing upload and browse but disallowing download

I think this question should be something easy but after searching all over the web I couldnt find an answer, so I decided to ask here. I have a file uploader in my website that works with php. The folder where files are being uploaded has 777…
Karevan
  • 139
  • 1
  • 16
0
votes
2 answers

restore permissions after set by error chmod -R 775 /

By error I set all folders and files permissions on 775, executing this command sudo chmod 775 -R /website/folder / And now I need to restore all the server folders and paths permissions at least centos files, by the moment I can't send emails from…
Chris
  • 33
  • 1
  • 8
0
votes
1 answer

FTP and allowing other users

I am trying to allow other people to work on my site with me. There are a couple of files/folders that I do not want them to be able to access / see. One file is dbase.php and the folder is ./crypt/ How do I go about not even allowing them to see…
AlanPHP
  • 188
  • 2
  • 3
  • 14
0
votes
2 answers

How to use "sudo" from a C program without using system()?

I have the following code: std::string cmd = "sudo chmod a+x file"; int r = system(cmd.c_str()); which works correctly. How can I do the same thing without calling the system() function? What I can get to is: #include int r =…
Pietro
  • 12,086
  • 26
  • 100
  • 193
-1
votes
1 answer

Using chmod for giving access to users

I need to provide access to a file in UNIX to particular users. How do i use chmod to do this?
Achyut
  • 35
  • 3
-1
votes
1 answer

chmod Make URL forbidden outside the site

I need a chmod solution for if I set mode of a directory 'app' in mysite.com/files/version1/app/index.html I am loading the above url in my site page as
UserBSS1
  • 2,091
  • 1
  • 28
  • 31
-1
votes
2 answers

Why I can not upload files using chmod() in PHP?

I want to upload an image on a remote host (Everything is ok locally). I've used the code below like my other previous projects to do it: if (move_uploaded_file($_FILES["scan"]["tmp_name"], 'images/scans/1.jpg')) { chmod…
Mohammad Saberi
  • 12,864
  • 27
  • 75
  • 127
-1
votes
2 answers

Wamp and file permissions using windows

Apologies if already answered. None of the listed answers seemed satisfactory. I'm using WAMP to build a site (obviously windows). Folder for images needs permissions turned on so they appear on the site. Everytime I use "Properties" on the folder,…
Martin M
  • 55
  • 1
  • 3
-1
votes
0 answers

Mac M1 + Xampp asking all the time to change CHMOD

Im working with PhpStorm + Laravel + XAMPP as a server. And all the time, when I upload new files into htdcos, it has a message, Please set the CHMOD permissions so this folder can be written. so, I have to manually all the time change chmod. Is it…
-1
votes
0 answers

AutoFs with specific user´s permissions

I have autofs working properly. I can mount a windows share on linux server without problems.But there is one issue: I don´t want that mounted share to be public to all linux users, just for a small group or a unique user. The auto.master file: # #…
Daniel Castro
  • 155
  • 1
  • 1
  • 10
-1
votes
0 answers

Error when trying to install Eclipse on MacOS 13.5 (Apple Sillicon) - Cannot run program "chmod": error=2, No such file or directory

I need to reinstall Eclipse on my laptop w/MacOS 13.5 (it was previously installed without issue). When using the Eclipse installer to install "Eclipse IDE for Enterprise Java and Web Developers" it is encountering the following error …
-1
votes
1 answer

Midnight Commander Chmod command

I dont know, how working difference between Set all, Set marked and Marked all. Because every buttons do same things. enter image description here For change in multiple files. Thank you. Multiple permission in files.