SCP not preserving user and group
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > SCP not preserving user and group




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    SCP not preserving user and group  
miles


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-22-07 12:20 AM

I must be doing something wrong. First off, I added the -p flag.

When I scp a file from my AIX fileserver to another AIX or HP-UX
server, the final user and group are, 0 0, ie. root:system (AIX) or
root:sys (HPUX).

Here is my test file:
ls -l pasdvu.htm
-rw-r-----   1 pasdev   oradba        17959 Mar 21 13:57 pasdvu.htm


Here is the command line I'm running:
scp -p /home/orasa/pasdvu.htm hpuxserver:/home/orasa/pasdvu.htm


Here is the end result:
ls -l
-rw-r-----   1 root       sys          17959 Mar 21 13:57 pasdvu.htm

Thanks Miles






[ Post a follow-up to this message ]



    Re: SCP not preserving user and group  
Todd H.


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-22-07 12:20 AM

"miles" <my_spam_account@shaw.ca> writes:

> I must be doing something wrong. First off, I added the -p flag.
>
> When I scp a file from my AIX fileserver to another AIX or HP-UX
> server, the final user and group are, 0 0, ie. root:system (AIX) or
> root:sys (HPUX).
>
> Here is my test file:
> ls -l pasdvu.htm
> -rw-r-----   1 pasdev   oradba        17959 Mar 21 13:57 pasdvu.htm
>
>
> Here is the command line I'm running:
> scp -p /home/orasa/pasdvu.htm hpuxserver:/home/orasa/pasdvu.htm
>
>
> Here is the end result:
> ls -l
> -rw-r-----   1 root       sys          17959 Mar 21 13:57 pasdvu.htm
>
> Thanks Miles

-p      Preserves modification times, access times, and modes
from the original file.

Note that it makes no mention of file ownership, however.

Curious if

scp -p /home/orasa/pasdvu.htm orasa@hpuxserver:/home/orasa

does what you want?



--
Todd H.
http://www.toddh.net/





[ Post a follow-up to this message ]



    Re: SCP not preserving user and group  
Florian Anwander


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-22-07 12:30 PM

Hi miles

> When I scp a file from my AIX fileserver to another AIX or HP-UX
> server, the final user and group are, 0 0, ie. root:system (AIX) or
> root:sys (HPUX).
>
> Here is my test file:
> ls -l pasdvu.htm
> -rw-r-----   1 pasdev   oradba        17959 Mar 21 13:57 pasdvu.htm
>
>
> Here is the command line I'm running:
> scp -p /home/orasa/pasdvu.htm hpuxserver:/home/orasa/pasdvu.htm
>
>
> Here is the end result:
> ls -l
> -rw-r-----   1 root       sys          17959 Mar 21 13:57 pasdvu.htm

It does not make sense to transport ownerships from one system to
another system, since you cannot rely on, that the user/group ids are
the same.
In worst case highly security relevant files yould become accesible by
common user groups.

Florian





[ Post a follow-up to this message ]



    Re: SCP not preserving user and group  
Helmut Springer


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-22-07 12:30 PM

In comp.sys.hp.hpux miles <my_spam_account@shaw.ca> wrote:
> Here is my test file:
> ls -l pasdvu.htm
> -rw-r-----   1 pasdev   oradba        17959 Mar 21 13:57 pasdvu.htm
>
> Here is the command line I'm running:
> scp -p /home/orasa/pasdvu.htm hpuxserver:/home/orasa/pasdvu.htm

You are doing that as root, i.e. login as root to hpuxserver?

> Here is the end result:
> ls -l
> -rw-r-----   1 root       sys          17959 Mar 21 13:57 pasdvu.htm

The target file will have the owner of the account you used to
authenticate on the target system.

If you want to preserve ownership, etc, you may want to look into
running rsync over ssh, or script an sftp batch.


--
MfG/Best regards
helmut springer





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:16 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register