LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   tar question (https://www.linuxquestions.org/questions/linux-newbie-8/tar-question-675073/)

alenD 10-08-2008 11:37 AM

tar question
 
when i use
tar cvzf mytar.tgz mydir
as as a user i get
tar: mytar.tgz: Cannot open: Permission denied

when i do the same as root it works fine
when, as a user, i enter mydir and do
tar cvzf mytar.tgz *
everything works fine again

i changed the permissions of mydir but the problem seems to be somewhere else. .. but cannot figure out where?

thnx

TB0ne 10-08-2008 11:51 AM

Quote:

Originally Posted by alenD (Post 3304234)
when i use
tar cvzf mytar.tgz mydir
as as a user i get
tar: mytar.tgz: Cannot open: Permission denied

when i do the same as root it works fine
when, as a user, i enter mydir and do
tar cvzf mytar.tgz *
everything works fine again

i changed the permissions of mydir but the problem seems to be somewhere else. .. but cannot figure out where?

thnx

The permissions on the directory you're in allow read, but not write. When you go into the mydir directory, you've obviously got write permissions.

Either chown the upper-level directory to be owned by you, or chmod it to allow writing by your user ID's group.

linuxman8786 10-08-2008 11:57 AM

Quote:

Originally Posted by TB0ne (Post 3304246)
The permissions on the directory you're in allow read, but not write. When you go into the mydir directory, you've obviously got write permissions.

Either chown the upper-level directory to be owned by you, or chmod it to allow writing by your user ID's group.

you try to you super root, like sudo in ubuntu


All times are GMT -5. The time now is 01:55 PM.