Berechtigung für andere Benutzer als root verweigert

388
Nitish

Ich habe ein Verzeichnis mit dem Namen saian /var/www/html/. Ich gab zuerst Erlaubnis 755und versuchte es 777. Ich habe mich als Benutzer angemeldet nitish. Wenn ich versuchte, die Dateien zu bearbeiten, heißt es, die Datei ist read-only. Wenn ich jedoch Dateien durch terminalProtokollierung als rootbearbeite, kann ich dieselben Dateien bearbeiten. Unten ist die ls -lBefehlsausgabe:

[root@localhost sai]# ls -l total 48 -rwxr-xr-x. 1 root root 5508 Mar 30 15:40 build-my-website.html -rwxr-xr-x. 1 root root 674 Mar 30 15:40 check.html drwxr-xr-x. 3 root root 4096 Mar 30 15:40 css drwxr-xr-x. 2 root root 4096 Mar 30 15:40 images -rwxr-xr-x. 1 root root 9002 Mar 30 15:40 index.html drwxr-xr-x. 2 root root 4096 Mar 30 15:40 js -rwxr-xr-x. 1 root root 4589 Mar 30 15:40 overview.html drwxr-xr-x. 4 root root 4096 Mar 30 15:40 slider 
0

1 Antwort auf die Frage

2
gronostaj

File permissions aren't inherited from parent directory on change. This is what ls's first column means: (rwx is read, write, execution)

[directory] [owner perms] [group perms] [everybody else's prems] d rwx r-x r-x 

As you can see, only owner (root, third column of ls) can write to the file. You can use chmod to allow everybody edit these files:

chmod go+w * 

or:

chmod a+w * 

First command means:

Allow (+) group members (g) and others (o) write (w) to the file, for all files (*).

Second one is

Allow everybody (a) write to the file.

Vielen Dank. Ich habe nach dieser Antwort gesucht. Danke für die Erklärung Nitish vor 11 Jahren 0