954,242 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

chmod 444 blowed my permissions

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
veledrom
Master Poster
755 posts since Apr 2008
Reputation Points: 42
Solved Threads: 0
 

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
rch1231
Posting Shark
959 posts since Sep 2009
Reputation Points: 119
Solved Threads: 142
 

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

veledrom
Master Poster
755 posts since Apr 2008
Reputation Points: 42
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: