- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- SCP Copy problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2010 06:53 AM
тАО01-22-2010 06:53 AM
SCP Copy problem
I have a problem making a copy from a Linux server to an HP-UX server, the copy I'm doing with the scp command with the-r and -p options, but then generated the copy and review on the HP-UX server the copy is made perfectly even with the same permissions, but the owner permissions of the folders and files change the ownership to root.
Anybody can help Me??
Thanks guys
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2010 07:06 AM
тАО01-22-2010 07:06 AM
Re: SCP Copy problem
This is standard behavior. You could create an empty file on the receiving server and establish its appropriate ownership. Then, perform your 'scp -p' transfer. Now the permissions, timestamps and ownership will be preserved.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2010 07:08 AM
тАО01-22-2010 07:08 AM
Re: SCP Copy problem
You can login as the file owner to do the scp and it keeps the original ownership.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2010 12:10 PM
тАО01-22-2010 12:10 PM
Re: SCP Copy problem
scp -rp /tmp/mydir billh@system2:/tmp
Then the directory (and files) will be owned by billh. For a password free copy, you'll have to setup the public key for the user billh.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2010 12:11 PM
тАО01-22-2010 12:11 PM
Re: SCP Copy problem
Not a very complete description of the OS
or the SSH software on this system.
> [...] an HP-UX server [...]
Not a very complete description of the OS
or the SSH software on this system.
Around here:
dyi # uname -a
HP-UX dyi B.11.31 U ia64 4235313755 unlimited-user license
dyi # ssh -V
OpenSSH_5.2p1+sftpfilecontrol-v1.3-hpn13v5, OpenSSL 0.9.8k 25 Mar 2009
HP-UX Secure Shell-A.05.20.015, HP-UX Secure Shell version
dyi # man scp
[...]
-p Preserves modification times, access times, and modes from the
original file.
[...]
Nothing there about owner/group. And not
without good reason.
Preserving ownership between different
systems can be difficult, especially when a
user exists on one system but not on the
other. It can also cause problems, when, for
example, a particular UID number translates
to different users on the different systems.
If you _really_ do wish to preserve the
UID/GID values, then you may be able to do
better using "tar". It should be possible to
string together a "tar" pipeline using ssh
(not quite scp, but close) for the remote
half.
> [...] with the-r and -p options [...]
> You could create an empty file [...]
Uh, _many_ empty files? Even if it works, it
sounds impractical.
> You can login as the file owner to do the
> scp and it keeps the original ownership.
Because all the files are certain to have the
same owner (and group)?
Providing a clear description of the problem
to be solved can reduce (but probably not
eliminate) the suggestions which don't really
apply to the actual situation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-23-2010 03:32 AM
тАО01-23-2010 03:32 AM
Re: SCP Copy problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-23-2010 03:50 AM
тАО01-23-2010 03:50 AM
Re: SCP Copy problem
> with same permission and subdirectories.
Ok.
> Why do we need to copy as the user who have
> the onwership of the files/dir.
You don't need to, if you don't care who owns
the files at the destination.
> [...] Can someone explain me this well
Again?
> Nothing there about owner/group. [...]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2010 03:32 AM
тАО01-24-2010 03:32 AM
Re: SCP Copy problem
cd source_dir; tar cf - dirs_and_files | ssh root@target "cd destin_dir; tar xf - "
Tar stores ownership and permissions if executed as root.
Or you can use rsync, which is perfect for the purpose.
HTH