首页 > 解决方案 > scp 冻结并创建空文件

问题描述

嗨,我需要使用 scp 将文件从 ubuntu 18.04 服务器放到 Raspberry,该文件是在目标目录中创建的,但它是 0 字节并且 scp 冻结。

这是 scp 命令:

scp -v /home/solergy/MANGO/MA_HOME_TERLIZZI/STM32_BINARIES/S07E-MCU-3AX.bin solergy@172.16.9.14:/home/solergy/ARTESHELL_IP/bin/

这是发送文件的 Ubuntu 服务器上的日志:

Executing: program /usr/bin/ssh host 172.16.9.14, user 

solergy, command scp -v -t /home/solergy/ARTESHELL_IP/bin/
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 172.16.9.14 [172.16.9.14] port 22.
debug1: Connection established.
debug1: identity file /home/solergy/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /home/solergy/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/solergy/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/solergy/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/solergy/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/solergy/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/solergy/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/solergy/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1 Raspbian-10+deb9u6
debug1: match: OpenSSH_7.4p1 Raspbian-10+deb9u6 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 172.16.9.14:22 as 'solergy'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecds..........256 SHA256:GLpj.......................o1ng
debug1: Host '172.16.9.14' is known and matches the ECDSA host key.
debug1: Found key in /home/solergy/.ssh/known_hosts:14
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:N0Ci............ihb/zI1DB..........Pc /home/solergy/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/solergy/.ssh/id_dsa
debug1: Trying private key: /home/solergy/.ssh/id_ecdsa
debug1: Trying private key: /home/solergy/.ssh/id_ed25519
debug1: Next authentication method: password
debug1: Authentication succeeded (password).
Authenticated to 172.16.9.14 ([172.16.9.14]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending command: scp -v -t /home/solergy/ARTESHELL_IP/bin/
Sending file modes: C0777 189264 S07E-MCU-3AX.bin
Sink: C0777 189264 S07E-MCU-3AX.bin

这是创建的空文件: 空的文件 关于问题出在哪里以及如何解决它的任何想法。谢谢,安东尼奥

标签: raspberry-pi3scpubuntu-18.04

解决方案


奇怪的是我使用 ssh 访问远程服务器没有问题,而是 scp 不工作。


推荐阅读