0

Hi,

I've done this silly thing. How can I bring old setting/permissions back.

Thanks advance

ubuntu@ubuntu:~$ sudo chmod 444 /var/www
[sudo] password for ubuntu: 
ubuntu@ubuntu:~$ ls -l /var/www
ls: cannot access /var/www/index.html: Permission denied
ls: cannot access /var/www/http: Permission denied
total 0
d????????? ? ? ? ?                ? http
-????????? ? ? ? ?                ? index.html
ubuntu@ubuntu:~$ sudo chmod 751 /var/www
ubuntu@ubuntu:~$ ls -l /var/www
ls: cannot open directory /var/www: Permission denied
ubuntu@ubuntu:~$ su root
Password: 
su: Authentication failure
ubuntu@ubuntu:~$ sudo chown root /var/www
ubuntu@ubuntu:~$ ls -l /var/www
ls: cannot open directory /var/www: Permission denied
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by veledrom
1

Hello

Try
sudo chmod 755 /var/www

Your problem is the third permission which is for every one else. First is the owner, second is the groups permissions and third is everyone else in the world. 755 will set it to rwxr-xr-x (r=4 w=2 and x=1 ) you add them to set each group of permissions.

ls -la /var/www/
total 32
drwxr-xr-x.  8 root      root 4096 2010-04-10 10:22 .
drwxr-xr-x. 27 root      root 4096 2010-08-12 00:28 ..
drwxr-xr-x.  2 root      root 4096 2010-04-10 10:22 cgi-bin
drwxr-xr-x.  3 root      root 4096 2010-07-12 07:15 error
drwxr-xr-x.  7 root      root 4096 2010-08-16 13:50 html
drwxr-xr-x.  3 root      root 4096 2010-07-12 07:15 icons
drwxr-xr-x. 14 root      root 4096 2010-07-12 07:25 manual
drwxr-xr-x.  2 webalizer root 4096 2010-08-08 03:11 usage

It is the next directory down (html) that should be set for apache to read:

ls -la /var/www/html
total 28
drwxr-xr-x.  7 root   root   4096 2010-08-16 13:50 .
drwxr-xr-x.  8 root   root   4096 2010-04-10 10:22 ..
drwxr-xr-x   2 apache apache 4096 2010-07-28 23:27 default.com
drwxr-xr-x  13 rod    apache 4096 2010-08-11 16:20 SmokeDepot
drwxr-xr-x   8 rod    apache 4096 2010-08-21 02:41 smokeshop
0

I cannot believe this. I meant to do 755 instead of 751. Anyway, you solved it. Thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.