I cant acces /var/www all of the sudden... also I would like to just give the user "loko" all the permissions. How can i get the error I am getting all of the sudden and how to fix it? Yesterday it worked fine.

share|improve this question
    
What command yielded this error? Also, have you got sudo permissions on the machine you are working with? I think output of ls -la /var/www might help too. – moon.musick Oct 23 '13 at 14:19
    
@moon.musick I just tried to open the directory – Loko Oct 23 '13 at 14:20
    
Open how? Using nautilus (i.e. the graphical file manager)? Using ls /var/www? Using Midnight Commander? There are many ways to access a directory. – moon.musick Oct 23 '13 at 14:22
    
@moon.musick Not sure really cause I started with Ubuntu yesterday but it's not with the command line. Probably Nautilus – Loko Oct 23 '13 at 14:27
    
Ok, if you have sudo access (you might check by opening a terminal and running sudo ls . or any other simple command - use your password for confirmation), you should be able to start privileged nautilus session with gksu nautilus. Then you'll have the access to restricted directories. Also, if you want to work with websites and such, I suggest you learn terminal commands, perhaps at linuxcommand.org – moon.musick Oct 23 '13 at 14:32
up vote 1 down vote accepted

Ok I figured it out.

These are the commands to give a directory or a file the permissions:

chmod 400 mydoc.txt read by owner
chmod 040 mydoc.txt read by group
chmod 004 mydoc.txt read by anybody (other)
chmod 200 mydoc.txt write by owner
chmod 020 mydoc.txt write by group
chmod 002 mydoc.txt write by anybody
chmod 100 mydoc.txt execute by owner
chmod 010 mydoc.txt execute by group
chmod 001 mydoc.txt execute by anybody

and I used this to give myself all the permissions:

sudo chown -R loko:sudo /home
share|improve this answer
1  
You can combine these commands to something like chmod 444 mydoc.txt. – don.joey Oct 23 '13 at 14:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.