Find the answer to your Linux question:
Results 1 to 6 of 6
I'm trying to upload a shopping cart program to my website. Because there are so many files, I packed them all in a TAR file (cart.tar). The directory on the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Apr 2004
    Posts
    173

    Permission problems using SSH


    I'm trying to upload a shopping cart program to my website. Because there are so many files, I packed them all in a TAR file (cart.tar). The directory on the server is /public_html/cart/ and the TAR file is located in that directory.

    I use
    Code:
    tar -xvf cart.tar
    while in the /public_html/cart/ directory and it extracts all the files and folders as it should. Now, the problem is every file has a CHMOD 600 permissions when they need to be 755 (in the /cart/ directory and all other sub-directories).

    I've tried
    Code:
    chmod 755 .
    and
    Code:
    chmod 755 *.*
    , but that only works for the current working directory. In order to get every file to have the 755 permissions, I need to CHMOD 755 every single directory. Is there an attribute of the
    Code:
    tar
    command that will extract all files with the 755 permission?

  2. #2
    Linux Newbie
    Join Date
    Apr 2004
    Posts
    173
    With
    Code:
    tar -xvf cart.tar
    it extracts all the directories with the 755 permission, but all the files in EVERY directory is 600. I want every directory and every file 775.

  3. #3
    Linux Engineer
    Join Date
    Oct 2004
    Location
    Vancouver
    Posts
    1,366
    have you tried adding the recursive tag, -r, to chmod?
    Operating System: GNU Emacs

  4. #4
    Just Joined!
    Join Date
    May 2005
    Posts
    52
    Quote Originally Posted by genesus
    have you tried adding the recursive tag, -r, to chmod?
    isnt it -R ????

  5. #5
    Just Joined!
    Join Date
    Nov 2004
    Location
    Iowa
    Posts
    43
    It is -R.

    Also try the -p flag to tar.

    Code:
    tar -xvpf cart.tar

    Should preserve permissions if they were set correct.

  6. #6
    Linux Newbie
    Join Date
    Apr 2004
    Posts
    173
    Thanks for the help. I remember doing it before, but I just couldn't figure out. I ended up extracting the files like before, but when I set the permissions, I tried
    Code:
    chmod -R 755 .
    Thanks for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •