PowerShell / PowerShell/Win32-OpenSSH

OpenSSH server hangs while transfering files with SCP

Open
#1,872 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

Troubleshooting steps
https://github.com/PowerShell/Win32-OpenSSH/wiki/Troubleshooting-Steps

Terminal issue? please go through wiki
https://github.com/PowerShell/Win32-OpenSSH/wiki/TTY-PTY-support-in-Windows-OpenSSH

Please answer the following

"OpenSSH for Windows" version
((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion)
8.1.0.1
ssh -V shows OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

Server OperatingSystem
((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion\" -Name ProductName).ProductName)
Windows 10 Home
but my system info is Windows 11 21H2 22000.376

Client OperatingSystem
macOS Mojave, Terminal, OpenSSH_7.9p1, LibreSSL 2.7.3
I can SSH login the Windows OpenSSH server, but can't transfer files with SCP

What is failing
transfering files with scp

Expected output
file transfered

Actual output

scp -v ~/Downloads/test.txt r9kk:
Executing: program /usr/bin/ssh host r9kk, user (unspecified), command scp -v -t .
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/user/.ssh/config
debug1: /Users/user/.ssh/config line 14: Applying options for r9kk
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to 192.168.50.39 [192.168.50.39] port 22.
debug1: Connection established.
debug1: identity file /Users/user/.ssh/r9kk.pub type 3
debug1: identity file /Users/user/.ssh/r9kk.pub-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_8.1
debug1: match: OpenSSH_for_Windows_8.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.50.39:22 as 'user'
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: ecdsa-sha2-nistp256 SHA256:iNcm2LsIVovNzGXjRHmPFTlyJxb+rSHBZdKR11n6piA
debug1: Host '192.168.50.39' is known and matches the ECDSA host key.
debug1: Found key in /Users/user/.ssh/known_hosts:18
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: Will attempt key: /Users/user/.ssh/r9kk.pub ED25519 SHA256:ySLDd9810vFyjCRc3HUxV/GyibwULAlubvsYD4ywuwg explicit agent
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/user/.ssh/r9kk.pub ED25519 SHA256:ySLDd9810vFyjCRc3HUxV/GyibwULAlubvsYD4ywuwg explicit agent
debug1: Server accepts key: /Users/user/.ssh/r9kk.pub ED25519 SHA256:ySLDd9810vFyjCRc3HUxV/GyibwULAlubvsYD4ywuwg explicit agent
debug1: Authentication succeeded (publickey).
Authenticated to 192.168.50.39 ([192.168.50.39]: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 LC_ALL = en_US.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_CTYPE = UTF-8
debug1: Sending command: scp -v -t .
Sending file modes: C0644 5002 test.txt
^Cdebug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Killed by signal 2.

It hangs at Sending file modes: C0644 5002 test.txt and I have to press CTRL-C to abort.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied scp command from macOS against the Windows OpenSSH 8.1.0.1 server and review the verbose output around “Sending file modes.” Trace the server-side scp handling involved in that command; done means the transfer completes instead of hanging and the file is created on the server.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cli, networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.