You are not logged in.

#1 2011-08-15 13:06:29

neoanima
Member
Registered: 2008-05-08
Posts: 40

[SOLVED]scp can't copy files

hi, pros.

     i can login to remote server with ssh, but while i want to copy file to that server using scp, it hangs there after authentication.

    given i copy a file named tags. i use command:

   $scp -v tags user@ip:~/

the option -v shows many debug infors. i paste here the part after successful authentication.

...
debug1: Enabling compression at level 6.
debug1: Authentication succeeded (password).
Authenticated to ip  ([ip]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending command: scp -v -t -- ~/

openssh version is OpenSSH_5.8p2, OpenSSL 1.0.0d 8 Feb 2011.
i tried the same command on other machine. scp works but the output is a slightly different with the last line in quoted texts. and
it is:

...
debug1: Sending command: scp -v -t ~/

the sending commad is different. there is no double hyphens in the worked one. 

could any one figure this out?
thanks a lot!

update: i updated three packages "openssh openssh-askpass openssl" today, and scp works.   someone must fix that problem. but we don't know what cause it.

Last edited by neoanima (2011-09-27 12:17:00)

Offline

#2 2011-08-15 13:12:56

neoanima
Member
Registered: 2008-05-08
Posts: 40

Re: [SOLVED]scp can't copy files

and kernel version is 2.6.39-ARCH #1 SMP PREEMPT Sat Jul 9 15:31:04 CEST 2011 i686 AMD Turion(tm) 64 X2 Mobile Technology TL-50 AuthenticAMD GNU/Linux

Offline

#3 2011-08-15 23:18:21

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [SOLVED]scp can't copy files

Does it work without the ~/ part? By default it will copy to your home dir, so this should do the same thing:

$scp -v tags user@ip:

Offline

#4 2011-08-24 10:21:12

neoanima
Member
Registered: 2008-05-08
Posts: 40

Re: [SOLVED]scp can't copy files

fukawi2 wrote:

Does it work without the ~/ part? By default it will copy to your home dir, so this should do the same thing:

$scp -v tags user@ip:

nope, no luck. it genetated the same messages.

...
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending command: scp -v -t -- .

still the double hyphen problem.

Offline

#5 2011-08-24 16:53:52

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [SOLVED]scp can't copy files

I think that you should check your server settings. I guess that -t means allocation of a tty and -- is just to stop parsing command line options. Everything works here:

$ scp rc.local ntc:~/
---
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending command: scp -t -- ~/
rc.local                                      100%  446     0.4KB/s   00:00    
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 2880, received 1976 bytes, in 0.4 seconds
Bytes per second: sent 8015.1, received 5499.2
debug1: Exit status 0

Notice the "--".

If you can ssh, just open a tunnel and pipe the copy through it:

ssh -xvNMS /tmp/ssh-%r@%h:%p server

and in another terminal

scp -o ControlPath=/tmp/ssh-%r@%h:%p file server:

and watch the debug1: messages in 1st terminal. This should copy the file...

Last edited by Leonid.I (2011-08-24 16:54:42)


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#6 2011-08-25 08:46:53

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,229
Website

Re: [SOLVED]scp can't copy files

You're on a mobile platform - any chance you're connecting wirelessly?

I have a similar problem using ssh and scp from my Archlinux-laptop to both my Archlinux homeserver and Debian officeserver. Sometimes it works, but more often it doesn't. I have no trouble connecting to those servers with ssh and scp from other (wired) pc's.

Offline

#7 2012-07-02 23:39:29

btb1
Member
Registered: 2012-07-02
Posts: 1

Re: [SOLVED]scp can't copy files

Hi,
I am having exactly the same problem as 'neoanima'. The post says its solved. However, it doesn't say how.

I am trying to scp a file from my macbook-pro (mac OS X 10.7) to a linux machine.

I've tried opening the ssh tunnel as suggested by 'Leonid.I'. However, even that doesn't work.
Debug session output is shown below...

I'd appreciate any help. Thanks.

B/.

PS: I've marked 'xxxx' for username/hostname/ip-addresses. thanks.

Server info:
----------------
Linux <mach-name> 2.6.32-71.29.1.el6.x86_64 #1 SMP Mon Jun 27 19:49:27 BST 2011 x86_64 x86_64 x86_64 GNU/Linux
CentOS Linux release 6.0 (Final)

~$ ssh -p 2772 -xvNMS /tmp/ssh-%r@%h:%p xxxx
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /Users/xxxx/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to atom [xxx.xxx.177.153] port 2772.
debug1: Connection established.
debug1: identity file /Users/xxxx/.ssh/id_rsa type 1
debug1: identity file /Users/xxxx/.ssh/id_rsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
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 '[xxx]:2772' is known and matches the RSA host key.
debug1: Found key in /Users/xxxx/.ssh/known_hosts:3
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received

[company banner]

debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/xxxx/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to atom ([xxx.xxx.177.153]:2772).
debug1: setting up multiplex master socket
debug1: channel 0: new [/tmp/ssh-xxxx@xxxx:2772]
debug1: Entering interactive session.
debug1: Entering interactive session.
debug1: multiplexing control connection
debug1: channel 1: new [mux-control]
debug1: channel 2: new [client-session]
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending command: scp -t -- /home/xxxx

Offline

Board footer

Powered by FluxBB