Win32-OpenSSH icon indicating copy to clipboard operation
Win32-OpenSSH copied to clipboard

A CMD window pops up every time an SSH or SCP or SFTP connection is made

Open jintianxiayu opened this issue 4 years ago • 11 comments

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 OpenSSH_for_Windows_8.6p1, LibreSSL 3.3.3

Server OperatingSystem win10 64

Client OperatingSystem win10 64

What is failing A CMD window pops up every time an SCP or SFTP connection is made

Expected output No cmd window pops up;

Actual output A cmd window pops up;

jintianxiayu avatar Feb 10 '22 03:02 jintianxiayu

bye, switch to apache sshd

jintianxiayu avatar Mar 01 '22 01:03 jintianxiayu

@jintianxiayu , This is a major issue, if it happens. We can't repro this issue. No one has informed this issue so far. Is the issue happening on the client machine or server machine?

bagajjal avatar Mar 01 '22 02:03 bagajjal

@bagajjal server machine;

the cmd window exists until data transform is over

jintianxiayu avatar Mar 01 '22 02:03 jintianxiayu

@jintianxiayu , I'm not sure how it's possible as we create new processes in session 0 for which you can't see any windows.

bagajjal avatar Mar 01 '22 17:03 bagajjal

@jintianxiayu Are you running the server in debug mode when you see this?

NoMoreFood avatar Mar 02 '22 08:03 NoMoreFood

I can confirm. Latest version, 10.0.0.0p2-Preview. I'm running sshd.exe directly, "portable way", not as a service. Tried it as a user and as admin. SSH works fine. With "Subsystem sftp internal-sftp" SFTP does not work at all, MobaXTerm shows empty SFTP browser, WinSCP says "Cannot initialize SFTP protocol. Is the host running a SFTP server?" With "Subsystem sftp C:\path\to\sftp-server.exe" both of these clients work, but on the host side a blank cmd.exe window appears until the session is closed. Also every time SFTP client downloads or uploads files another blank window appears. I think it shouldn't be like that.

sane4ektopz avatar Feb 23 '26 06:02 sane4ektopz

@bagajjal

sane4ektopz avatar Feb 24 '26 06:02 sane4ektopz

I'm running sshd.exe directly, "portable way", not as a service. Tried it as a user and as admin.

What do you mean by "portable way"? It sounds like you are running the ssh server in debug mode.

tgauth avatar Feb 24 '26 14:02 tgauth

in debug mode.

I don't know if it's a debug mode. My steps are:

  • download OpenSSH-Win64.zip
  • extract it somewhere like "C:\Users\User\Desktop\ssh"
  • configure sshd_config
  • with powershell cd to that directory
  • run .\sshd.exe -f .\sshd_config

Is that debug mode? I also tried to start it with Task Scheduler but no, problem is the same.

sane4ektopz avatar Feb 24 '26 15:02 sane4ektopz

Is that debug mode? I also tried to start it with Task Scheduler but no, problem is the same.

Yes, it is. Here are the instructions for using the install script within OpenSSH-Win64.zip to setup the service: https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH

tgauth avatar Feb 24 '26 16:02 tgauth

Yes, it is. Here are the instructions for using the install script within OpenSSH-Win64.zip to setup the service: https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH

Yea, I know about it. But in my case that's not what I need basically because of a lack of admin rights on my machine. So it turns out this weird behavior is normal behavior. Okay then, thank you!

sane4ektopz avatar Feb 24 '26 16:02 sane4ektopz