Unix administration - SCP not preserving user and group

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > March 2007 > SCP not preserving user and group





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author SCP not preserving user and group
miles

2007-03-21, 7:20 pm

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

Todd H.

2007-03-21, 7:20 pm

"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/
Florian Anwander

2007-03-22, 7:30 am

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
Helmut Springer

2007-03-22, 7:30 am

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
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com