1748128 Members
3885 Online
108758 Solutions
New Discussion юеВ

Re: scp query

 
SOLVED
Go to solution
himacs
Super Advisor

scp query

Hi Admins,

When i copied a dir using scp ,soft links are not getting copied.Please tell me how to include soft links also when copying any dir..


Regards
himacs
7 REPLIES 7
TwoProc
Honored Contributor
Solution

Re: scp query

I you want symbolic links to transfer correctly, then scp by itself is not your friend. If you want your sym links to copy correctly, you need to use tar instead. Tar up all the files you want sent, scp the tar file over, and then untar the files on the destination server.
We are the people our parents warned us about --Jimmy Buffett
himacs
Super Advisor

Re: scp query

Hi TwoProc,

Thanks for the response..

I am copying the files from HPUX to Linux system using scp.But ended up getting stalled error.Now after giving password nothing happening.When i tried debugging got below message.Please help on this..

===================

debug1: Connection established.
debug1: permanently_set_uid: 0/3
debug1: identity file /.ssh/identity type -1
debug1: identity file /.ssh/id_rsa type 1
debug1: identity file /.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH_4*
debug1: Remote is NON-HPN aware
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2p1+sftpfilecontrol-v1.3-hpn13v5
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: AUTH STATE IS 0
debug1: REQUESTED ENC.NAME is 'aes128-ctr'
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: REQUESTED ENC.NAME is 'aes128-ctr'
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '10.11.10.20' is known and matches the RSA host key.
debug1: Found key in /.ssh/known_hosts:4
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /.ssh/identity
debug1: Offering public key: /.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: /.ssh/id_dsa
debug1: Next authentication method: password
root@10.11.10.20's password:
debug1: Authentication succeeded (password).
debug1: HPN to Non-HPN Connection
debug1: Final hpn_buffer_size = 131072
debug1: HPN Disabled: 1, HPN Buffer Size: 131072
debug1: channel 0: new [client-session]
debug1: Entering interactive session.

==================


What will be the possible issue.

Regards
himacs

Sundar G
Frequent Advisor

Re: scp query

Have you enabled password less authentication b/w HPUX and the linux machine?

himacs
Super Advisor

Re: scp query

Him

Root lv was full ..so i was not able to login..

Now its fine


Regards
himacs
Doug O'Leary
Honored Contributor

Re: scp query

Hey;

Another option to tar'ing up the directory on the source host and scp'ing the tarball over is to do it all in one swell foop:

# copying /home/dkoleary from localhost to a remote host:
cd /home
tar -cf - dkoleary | ssh ${remote} "cd /home; tar -xvf -"

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
TwoProc
Honored Contributor

Re: scp query

cpio also handles links correctly. In fact, I used to use cpio quite often because of this.

However, I'd stick with tar.

As long as you've got ssh keys working correctly, Doug's recommendation will work great for you, but you'll need that login across both machines to be root for it to work, as the user directory in /home on the destination machine doesn't exist yet.

But.... on most machines nowadays, direct root access is blocked via ssh.

Good luck!
We are the people our parents warned us about --Jimmy Buffett
Doug O'Leary
Honored Contributor

Re: scp query

Hey



>>But.... on most machines nowadays, direct root access is blocked via ssh.

Direct *password* access to root should be prohibited via any mechanism - ssh/scp/ftp/telnet

Direct ssh/public key authentication access to root is more secure than the standard sudo approach.



But, that's the topic of several different topics. Sorry for hijacking the thread - thought I'd add that little bit of extra...

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html