我需要通过 VPN 将文件从我的 mac os 传输到 ubuntu 服务器。我可以通过 ssh 进入它,但是当我尝试使用 scp 发送文件(任何大小)时,传输会停滞。
这是错误的堆栈跟踪。我可以从另一个客户端 SCP,所以我认为这与我的系统有关
scp -vvv -l 1000 target/file.jar [email protected]:/home/assist
Executing: program /usr/local/Cellar/openssh/7.9p1/bin/ssh host 99.0.0.85, user assist, command scp -v -t /home/assist
OpenSSH_7.9p1, OpenSSL 1.0.2p 14 Aug 2018
debug1: Reading configuration data /Users/mario/.ssh/config
debug1: /Users/mario/.ssh/config line 7: Applying options for 99.0.0.*
debug3: kex names ok: [ecdh-sha2-nistp521]
debug1: Reading configuration data /usr/local/etc/ssh/ssh_config
debug2: resolve_canonicalize: hostname 99.0.0.85 is address
debug2: ssh_connect_direct
debug1: Connecting to 99.0.0.85 [99.0.0.85] port 22.
debug1: Connection established.
debug1: identity file /Users/mario/.ssh/id_rsa type 0
debug1: identity file /Users/mario/.ssh/id_rsa-cert type -1
debug1: identity file /Users/mario/.ssh/id_dsa type -1
debug1: identity file /Users/mario/.ssh/id_dsa-cert type -1
debug1: identity file /Users/mario/.ssh/id_ecdsa type -1
debug1: identity file /Users/mario/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/mario/.ssh/id_ed25519 type -1
debug1: identity file /Users/mario/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/mario/.ssh/id_xmss type -1
debug1: identity file /Users/mario/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 99.0.0.85:22 as 'assist'
debug3: hostkeys_foreach: reading file "/Users/mario/.ssh/known_hosts"
debug3: hostkeys_foreach: reading file "/Users/mario/.ssh/known_hosts2"
debug3: record_hostkey: found key type ECDSA in file /Users/mario/.ssh/known_hosts2:70
debug3: load_hostkeys: loaded 1 keys from 99.0.0.85
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: ecdh-sha2-nistp521,ext-info-c
debug2: host key algorithms: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected]
debug2: compression stoc: none,[email protected]
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: ecdh-sha2-nistp521
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:6tpm0O5MKcH7nTsKuZx1K2466BM9S9VBIuTqYdiB2ng
debug3: hostkeys_foreach: reading file "/Users/mario/.ssh/known_hosts"
debug3: hostkeys_foreach: reading file "/Users/mario/.ssh/known_hosts2"
debug3: record_hostkey: found key type ECDSA in file /Users/mario/.ssh/known_hosts2:70
debug3: load_hostkeys: loaded 1 keys from 99.0.0.85
debug1: Host '99.0.0.85' is known and matches the ECDSA host key.
debug1: Found key in /Users/mario/.ssh/known_hosts2:70
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug1: Will attempt key: /Users/mario/.ssh/id_rsa RSA SHA256:M1Jh1ocVSjwoOSK1so1j+N8rabbKiPV0WNti4NdtCX4
debug1: Will attempt key: /Users/mario/.ssh/id_dsa
debug1: Will attempt key: /Users/mario/.ssh/id_ecdsa
debug1: Will attempt key: /Users/mario/.ssh/id_ed25519
debug1: Will attempt key: /Users/mario/.ssh/id_xmss
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/mario/.ssh/id_rsa RSA SHA256:M1Jh1ocVSjwoOSK1so1j+N8rabbKiPV0WNti4NdtCX4
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: /Users/mario/.ssh/id_rsa RSA SHA256:M1Jh1ocVSjwoOSK1so1j+N8rabbKiPV0WNti4NdtCX4
debug3: sign_and_send_pubkey: RSA SHA256:M1Jh1ocVSjwoOSK1so1j+N8rabbKiPV0WNti4NdtCX4
debug3: sign_and_send_pubkey: signing using rsa-sha2-512
debug3: send packet: type 50
debug3: receive packet: type 52
debug1: Authentication succeeded (publickey).
Authenticated to 99.0.0.85 ([99.0.0.85]:22).
debug2: fd 4 setting O_NONBLOCK
debug2: fd 5 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting [email protected]
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: receive packet: type 80
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x20
debug2: client_session2_setup: id 0
debug1: Sending command: scp -v -t /home/assist
debug2: channel 0: request exec confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
Sending file modes: C0744 40427054 emanager.jar
debug2: channel 0: rcvd ext data 34
Sink: C0744 40427054 emanager.jar
debug2: channel 0: written 34 to efd 6
file.jar
5% 2112KB 122.3KB/s - stalled -
debug3: send packet: type 1
如果我登录服务器并将 ssh 日志设置为 VERBOSE,我就只能在 /var/log/auth.log 中看到
Nov 18 17:23:13 MiddlewareLayer sshd[32565]: Accepted publickey for assist from xxx.xxx.xxx.xxx port 54490 ssh2: RSA SHA256:M1Jh1ocVSjwoOSK1so1j+N8rabbKiPV0WNti4NdtCX4
Nov 18 17:23:13 MiddlewareLayer sshd[32565]: pam_unix(sshd:session): session opened for user assist by (uid=0)
Nov 18 17:23:13 MiddlewareLayer systemd-logind[1044]: New session 258796 of user assist.
仅此而已...我几周前就能够连接到它了,从那时起就不应该发生任何变化
我重新启动了 ssh 并进行了完整调试……一切似乎都很顺利
它阻塞于
Starting session: command for assist from 172.78.78.172 port 54959 id 0
debug3: mm_audit_run_command entering command scp -t /home/assist
debug3: mm_request_send entering: type 113
debug3: mm_request_receive entering
debug3: monitor_read: checking request 113
debug3: mm_answer_audit_command entering
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x08
debug2: fd 10 setting O_NONBLOCK
debug2: fd 9 setting O_NONBLOCK
debug2: fd 12 setting O_NONBLOCK
debug3: send packet: type 99
debug2: channel 0: read 121 from efd 12
debug2: channel 0: rwin 2097152 elen 121 euse 1
debug2: channel 0: sent ext data 121
debug2: channel 0: read 44 from efd 12
debug2: channel 0: rwin 2097031 elen 44 euse 1
debug2: channel 0: sent ext data 44
debug2: channel 0: read 307 from efd 12
debug2: channel 0: rwin 2096987 elen 307 euse 1
debug2: channel 0: sent ext data 307
这是我在传输过程中遇到“停滞”的情况...