![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Linux Support Linux - Operating Systems and Applications Support |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Oct 2008
Posts: 2
OS: XP sp2
|
unzip and retain original ownersip/permissions
Hi all
(first time poster) I develop on XP but host sites on a Linux VPS. To speed the upload process I zip the site on mp XP machine, ftp the zip file to the server and then SSH to the server and 'unzip' the file. This works fine most of the time, however in one particular application there are some important permissions that I need retained. XP of course has no specific permissions and therefore unzip applies the default umask and the currently logged on users ownership and group. What I really need is the original ownership of the existing file retained. Any ideas how this can be done? Cheers mc |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Registered User
Join Date: Mar 2008
Posts: 82
OS: ubuntu,fedora,opensuse,xp,vista
|
Re: unzip and retain original ownersip/permissions
I am unsure of what you are asking for? You want the permissions of a zipped windows xp file to go over to an Unix/GNU system to remain the same permission? Or you want a Unix/GNU zipped file permission to remain the same while transing to Windows XP? But as you stated before Window's OS and Unix/GNU's OS has two different permission tree if you will. So, that's an issue already.
As what I have seen in transfering files between the two OSs usally anything from Window's base OS will require a root access to write to the original file. And anything from an Unix/GNU's base OS will be write-able as default. Hope that helps some, Sugi PS: Please reply with more details |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: Oct 2008
Posts: 2
OS: XP sp2
|
Re: unzip and retain original ownersip/permissions
Okay - being really specific:
XP file: index.php - no particular permissions XP zip of index.php to site.zip FTP site.zip to Linux machine Linux now has two files: index.php user7 group2 -rw-rw-r-- (this is the existing file that will be replaced) site.zip ftpuser group1 -rw-r--r-- (this has been created via ftp) Linux - now I unzip the site.zip file and I will be overwriting index.php, what I want is: index.php user7 group2 -rw-rw-r-- (the new file with the same ownership etc) Linux - but what I get is: index.php collingwood group1 -rw-r--r-- (the ownership of me currently logged in) Hope this is clear. Cheers mc |
|
|
|
|
|
#4 (permalink) |
|
Registered User
Join Date: Oct 2007
Location: Littleton, Colorado USA
Posts: 470
OS: xp 64 sp2 Fedora Core 8 (vmware xp core 8 x32) Minix
|
Re: unzip and retain original ownersip/permissions
Piece of cake!!! Sort-of.
Add group1 to the /etc/group file using /usr/sbin/groupadd. "/usr/sbin/usermod -G group2 collinswood" (you already belong to group1 because your administrator set that up for you) If you run the command "groups" you should see that you now belong to two groups "group1" and "group2" You are going to have to setup "user7" the normal way of adding a new user. To become the new user just do "su - user7" from user "collingwood" and enter the password. Remember that the program "su" is for "set user" not "superuser". If user7 does not belong to group2 then to change it to the new group enter "newgrp group2" and you are now in the proper group. Test this by using the "touch" command. It might just be easier to add yourself "collinwood" to both groups (group1 and group2) and run "chmod 664 index.php" and then run "chown user7.group2 index.php". Unix used to allow you to set a file to a group or user to which you didn't belong. Somebody went stupid and fixed this feature! Don't forget the dot between user7 and group2. Recall that 664 stands for rw-rw-r--. r's are 4's, w's are 2's, and x's are 1's. Just add then up. x stands for the execute bit. Values are grouped into threes. Hope this helps. Last edited by lensman3; 10-13-2008 at 07:06 PM. Reason: usermod instead of useradd |
|
|
|
![]() |
| Thread Tools | |
|
|