Questions tagged [777]

The maximum file permissions (ie Read, Write, and Execute) that can be assigned to a directory or file on a Unix-based operating system (including Linux).

777 = "-rwxrwxrwx" = rwx for all

0 --- no permission
1 --x execute
2 -w- write
3 -wx write and execute
4 r-- read
5 r-x read and execute
6 rw- read and write
7 rwx read, write and execute

The first character in the mode string -rwxrwxrwx indicates file type and is not related to permissions, a couple of examples:

-rwxrwxrwx  // normal file
drwxrwxrwx  // directory
lrwxrwxrwx  // symbolic link
prwxrwxrwx  // named pipe
srwxrwxrwx  // socket

From maketecheasier:

Every file and folder contains 8-bit data that controls the permissions. At its basic binary form, it will be “000”, which means no permission of any form is granted. When you set a “Read” permission, it will add 4-bit to the data, making it “100” (in binary format) or a “4” in the usual decimal format. Setting a “Write” permission will add 2-bit to the data, making it “010” and “2” in decimal form. Lastly, setting an “Execute” permission adds 1-bit to the data, which will result in “001”, or “1” in decimal form. In short:

  • Read is equivalent to ‘4’.
  • Write is equivalent to ‘2’.
  • Execute is equivalent to ‘1’

When we want to set permissions, we just add up the number. For example, to set the permissions to read and write, we will use ‘6’ (4 + 2) for the permission. For read, write and execute, we will use ‘7’ (4 + 2 + 1) for the permission.

30 questions
3
votes
1 answer

Is it safe to CHMOD directories 777 on a VPS?

I have some php scripts that need to move, create and delete files and folders. Unless I CHMOD the folders to 777 the php scripts die with errors about permissions. CHMOD'ing the folders to 777 fixes the problem, but after a lot of reading I'm still…
Nate
  • 22,356
  • 31
  • 115
  • 196
2
votes
0 answers

Permission denied on virtualbox jupyter notebook

I have set up an Ubuntu virtualbox on my Win 10 laptop, but am having difficulty using magic to use a file. So far all I have is %install_ext https://raw.githubusercontent.com/SchlossLab/ipython-mothurmagic/master/mothurmagic.py %load_ext…
otsu
  • 449
  • 4
  • 12
2
votes
3 answers

PHP file_put_contents not working WITH 777 permissions and Apache permissions

I'm currently trying to use file_put_contents to update a JSON file of mine. This is what my PHP currently looks like: $result = file_put_contents('Resources/logs/file.json', $newJsonString); if($result === true) { echo "true"; } else { echo…
user3681788
  • 221
  • 3
  • 15
2
votes
5 answers

Can't save file with other permissions except for 777

I have a script that resizes images and then save the new images. I can't save the new image if the original image didn't have 777 permissions. I know that 777 is risky, so when using different permissions such as 775 or 755 it does nothing. Why…
Ron
  • 3,677
  • 16
  • 69
  • 117
2
votes
1 answer

Find all .php files inside directories with 777 permissions

I have recently had a linux server compromised from bots uploading .php scripts and posing as images. I'm currently in the process of fixing this. Because my server has a lot of websites I'm looking for a linux command to scan through all the 777…
pleshy
  • 1,350
  • 2
  • 14
  • 22
1
vote
2 answers

chmod 777 - requirement of this is a server issue?

If a PHP script on the server can't create a directory, is this usually because PHP is running as apache/nobody? So can you say from this that the server is misconfigured? (or just using the standard configuration) For security purposes it would be…
user429620
1
vote
1 answer

Image Upload Error due to permission denied to write

I have an upload image feature in my website. I tried it in my localhost and it was working fine. Now I hosted it, and the following error occured: move uploaded file failed to open stream permission denied I checked the error online and found…
printfjoby
  • 78
  • 1
  • 10
1
vote
1 answer

file_put_contents() needs dangerous 777 access

Not a specific coding problem but every thread I search where people talk about 777 server files involves server related questions not php. I realize I shouldn't be setting 777 file permissions on my server due to security concerns. Is there a safer…
LazyPeon
  • 339
  • 1
  • 16
1
vote
1 answer

Wordpress wp-content Permissions settings behaviour on different servers

I built a WP site on a particular server. I did not set or change any folder permissions and everything worked perfectly. Mainly, I could upload files and images. I then moved the install to a different server and domain. Suddenly I could not upload…
Scott Eldo
  • 443
  • 6
  • 25
1
vote
1 answer

Python script runs via apache when permissions are 755 but gives Error 500 when 777?

I uploaded a basic python script to my shared hosting at Dreamhost, and changed the permissions to 777. It ran fine from the shell (via SSH) but would display a 'Server Error' when called from the browser. In the error.log, the error was 'Premature…
Pranab
  • 1,341
  • 3
  • 19
  • 36
1
vote
1 answer

linux chmod -R 777 /var/

By mistake I give via ssh with root privelege a chmod -R 777 /var/ in stead of chmod -R 777 var/ for a var folder inside a home directory. Now I cannot login again via ssh. I have a resque mode availble. What to do? Does someone this?
Paul Maas
  • 55
  • 1
  • 1
  • 7
1
vote
1 answer

PHP mkdir() and move_uploaded_file() Permission Denied with 777

I am writing a PHP script for a client which will be installed on a server which I do not have back-end access to. I only have access to a particular folder and database. My script will upload files and create folders. However I get a permission…
Oliver Spryn
  • 15,563
  • 30
  • 91
  • 184
0
votes
2 answers

How do I assign a chmod value of 0777 at the point it the file is uploaded (PHP)?

My system features a conversation area which writes to and draws from a .txt file. I am obviously able to set the permissions through my FTP client but I'm looking to apply the writable functionailty to all files that are uploaded through my system…
Ollie Jones
  • 369
  • 1
  • 7
  • 16
0
votes
2 answers

php create new dir with 777 permission. How?

In my code $path = 'images/product/'.$pid; if( ! file_exists($path)) { mkdir($path, 0777); } ... ... but when I type ls -l in terminal drwxr-xr-x 2 www-data www-data 4.0K 2011-12-10 19:28 1/ This is the permission that I get, but is not I…
Js Lim
  • 3,329
  • 5
  • 32
  • 65
0
votes
0 answers

wordpress cache plugin file permissions

I was using WP Fastest Cache and my site kept getting hacked by having links inserted into posts and pages. The plugin was creating cached files with 666 permissions. So I removed that plugin and installed W3 Total Cache. It's creating files with…
George
  • 844
  • 2
  • 10
  • 21
1
2