1

I have a Windows 2000 server that I installed WinSCP 4.4.0 on, and a Windows 2016 server that I installed an OpenSSH server on.

I can ssh into the Windows 2016 server fine from Linux, as well as from the Windows 2000 server using PuTTY. I can also run WinSCP and connect to the Windows 2016 server using SFTP. However when I try connecting with WinSCP using the SCP protocol, I get that error about not being able to start a shell/command.

Here is the full log on the Windows 2000 side:

. 2019-05-21 15:22:37.406 --------------------------------------------------------------------------
. 2019-05-21 15:22:37.406 WinSCP Version 4.4.0 (Build 1904) (OS 5.0.2195 Service Pack 4)
. 2019-05-21 15:22:37.406 Configuration: HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\
. 2019-05-21 15:22:37.406 Local account: Win2000_host\root
. 2019-05-21 15:22:37.406 Login time: Tuesday, May 21, 2019 3:22:37 PM
. 2019-05-21 15:22:37.406 --------------------------------------------------------------------------
. 2019-05-21 15:22:37.406 Session name: mssql conversion (Modified stored session)
. 2019-05-21 15:22:37.406 Host name: <win2016_ip> (Port: 22)
. 2019-05-21 15:22:37.406 User name: my_user (Password: Yes, Key file: Yes)
. 2019-05-21 15:22:37.406 Tunnel: No
. 2019-05-21 15:22:37.406 Transfer Protocol: SCP
. 2019-05-21 15:22:37.406 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2019-05-21 15:22:37.406 Proxy: none
. 2019-05-21 15:22:37.406 SSH protocol version: 2; Compression: No
. 2019-05-21 15:22:37.406 Bypass authentication: No
. 2019-05-21 15:22:37.406 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: 
No
. 2019-05-21 15:22:37.406 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2019-05-21 15:22:37.406 SSH Bugs: A,A,A,A,A,A,A,A,A
. 2019-05-21 15:22:37.406 SFTP Bugs: A,A
. 2019-05-21 15:22:37.406 Return code variable: Autodetect; Lookup user groups: Yes
. 2019-05-21 15:22:37.406 Shell: default
. 2019-05-21 15:22:37.406 EOL: 0, UTF: 2
. 2019-05-21 15:22:37.406 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2019-05-21 15:22:37.406 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2019-05-21 15:22:37.406 Local directory: F:\bk\development, Remote directory: 
/C:/Users/my_user/Downloads, Update: No, Cache: Yes
. 2019-05-21 15:22:37.406 Cache directory changes: Yes, Permanent: Yes
. 2019-05-21 15:22:37.406 DST mode: 1
. 2019-05-21 15:22:37.406 --------------------------------------------------------------------------
. 2019-05-21 15:22:37.406 Looking up host "<win2016_ip>"
. 2019-05-21 15:22:37.406 Connecting to <win2016_ip> port 22
. 2019-05-21 15:22:37.515 Server version: SSH-2.0-OpenSSH_for_Windows_7.9
. 2019-05-21 15:22:37.515 Using SSH protocol version 2
. 2019-05-21 15:22:37.515 We claim version: SSH-2.0-WinSCP_release_4.4
. 2019-05-21 15:22:37.578 Using Diffie-Hellman with standard group "group14"
. 2019-05-21 15:22:37.578 Doing Diffie-Hellman key exchange with hash SHA-1
. 2019-05-21 15:22:37.875 Host key fingerprint is:
. 2019-05-21 15:22:37.875 ssh-rsa 2048 3d:00:8f:80:66:c8:d9:68:46:fe:3f:4d:a2:f7:bc:c2
. 2019-05-21 15:22:37.875 Initialised AES-256 SDCTR client->server encryption
. 2019-05-21 15:22:37.875 Initialised HMAC-SHA1 client->server MAC algorithm
. 2019-05-21 15:22:37.875 Initialised AES-256 SDCTR server->client encryption
. 2019-05-21 15:22:37.875 Initialised HMAC-SHA1 server->client MAC algorithm
. 2019-05-21 15:22:38.000 Reading private key file "C:\Documents and Settings\root\ssh\id_rsa.ppk"
! 2019-05-21 15:22:38.000 Using username "my_user".
. 2019-05-21 15:22:38.046 Offered public key
! 2019-05-21 15:22:38.093 Server refused our key
. 2019-05-21 15:22:38.093 Server refused our key
. 2019-05-21 15:22:38.093 Attempting keyboard-interactive authentication
. 2019-05-21 15:22:38.140 Server refused keyboard-interactive authentication
. 2019-05-21 15:22:38.140 Prompt (7, SSH password, , &Password: )
. 2019-05-21 15:22:38.140 Using stored password.
. 2019-05-21 15:22:38.140 Sent password
. 2019-05-21 15:22:38.187 Access granted
. 2019-05-21 15:22:38.390 Opened channel for session
. 2019-05-21 15:22:38.531 Server refused to start a shell/command
* 2019-05-21 15:22:38.531 (ESshFatal) Server refused to start a shell/command
* 2019-05-21 15:22:38.531 Authentication log (see session log for details):
* 2019-05-21 15:22:38.531 Using username "my_user".
* 2019-05-21 15:22:38.531 Server refused our key.
* 2019-05-21 15:22:38.531 
* 2019-05-21 15:22:38.531 Authentication failed.

I checked the event viewer on the Windows 2016 server for the OpenSSH service. This is all it said:

sshd: Accepted password for my_user from <win2000_ip> port 37288 ssh2

I'm at a loss, I am not sure what's wrong with the way I'm sshing in. There are no errors on the server side, only the client side. And there doesn't seem to be a way to disable starting a shell in WinSCP 4.4.0.

Let me know if there is any other information that may help diagnose this issue, thanks.

Martin Prikryl
  • 7,756
  • 2
  • 39
  • 73
Scriptonaut
  • 137
  • 6

1 Answers1

1

I do not have an answer to why you get this specific error (I get past that point when I try WinSCP against Windows OpenSSH server).

But even if you solve that, it's unlikely to help you. WinSCP needs *nix-like shell. And Windows OpenSSH server does not come with one. So you will get another error, even if you solve this one.

So the question is rather, why do you even want to use SCP, if SFTP works.

Martin Prikryl
  • 7,756
  • 2
  • 39
  • 73
  • The reason I wanted to use SCP was because SFTP is a lot slower. I ended up uninstalling the windows openssh server, and installing cygwin, with openssh. That solved the issue with the shell. Ideally I would be able to use something even faster, and that could pick up where it left off, like rsync, but since I'm stuck using a windows 2000 server as the client that's not very easy. – Scriptonaut May 22 '19 at 22:40