I'm having a real tough time getting this done correctly. I'm on a LINUX server. Control panel is H-SPHERE with WebShell as the file manager tool. I TAR'd some files from one site then brought it over from another site. When I untar it using the WebShell tool, it seems to set all the folders/files with the same permissions, and does not retain the original permissions. Is there a better way to do this? I tried WS_FTP_PRO, and some other tools, but i just can't get it work correctly. Advice and insight so I can do this correctly would be great. thanks in advance.
from ssh: Creating a tar file: tar -cvwf file.tar myfile.txt In the above example the system would create a tar named file.tar in the directory you currently are in. Wildcards could also be used in this command, for example: tar -cvwf file.tar *.txt would compress all txt files in the current directory. tar -cvwf home.tar home/ In the above example command the system would create a tar file named home.tar in the directory you currently are in of the home directory. Extracting the files from a tar file: tar -xvwf myfile.tar In the above example command the system would uncompress (untar) the myfile.tar file in the current directory. tar -xvwzf myfile.tar.gz In the above example command the system would uncompress (untar) the myfile.tar.gz file in the current directory. source: http://r00tsecurity.org/forums/index.php?showtopic=18405
Once the directory is untarred why not just go back and recursively change the file perms/owners to what they need to be. tar xvf /tmp/myfile.tar /home/user/htdocs Then recursivley change the file owners in htdocs chown -R user:group /home/user/htdocs