OpenSSH SFTP not working

marcus hob 21 Reputation points
2021-06-15T03:58:56.193+00:00

Here is just a repost from the MS Community where the Moderator suggests me to post here
(link: https://answers.microsoft.com/en-us/windows/forum/all/openssh-sftp-not-working/80c211dc-5752-4d2e-a02c-4a6a4255d809)

Hello everyone,

I'm trying to setup openssh and sftp protocol in both of my computers by following this guide from Microsoft:

https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse

I've successfully remoted login from my client computer to my server computer by using ssh username@servername command in the Powershell (Run as administrator). However, I still have struggled to connect my client computer to my server computer with sftp command in powershell.

In both computer, I've tried to input sftp localhost to check if it is a local problem for each computer. For my client computer, I've successfully logged in SFTP protocol with the shell shown:

PS C:\WINDOWS\system32> sftp localhost

client**anonymous user*'s password:*

Connected to localhost.

sftp>

However, it doesn't work properly in my server computer:

PS C:\Users\Server> sftp localhost

Serveranonymous user's password:

^ I will get stuck here forever after entering the correct password until I cancel it. Furthermore, here is what i got for inputting sftp -vvv localhost after entering my password for your reference:

uoas04*anonymous user*'s password:

debug3: send packet: type 50

debug2: we sent a password packet, wait for reply

debug3: receive packet: type 52

debug1: Authentication succeeded (password).

Authenticated to localhost ([::1]: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 no-more-sessions@openssh.com

debug3: send packet: type 80

debug1: Entering interactive session.

debug1: pledge: network

debug3: receive packet: type 80

debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0

debug3: receive packet: type 91

debug2: channel_input_open_confirmation: channel 0: callback start

debug2: fd 3 setting TCP_NODELAY

debug2: client_session2_setup: id 0

debug1: Sending subsystem: sftp

debug2: channel 0: request subsystem 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: subsystem request accepted on channel 0

It seems like to me that my server computer get stuck on executing sftp program by itself. I've already tried to reinstall and cleaning all the temporary OpenSHH files serval times already, but nothing works. I just want to see if anyone has a solution for me here for fixing my sftp issue on my server computer. Please let me know if you guys have any suggestion hopefully. Thanks in advance.

(I think it maybe also there're conflict between internal-sftp and openssh sftp?)

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,950 questions
{count} votes

Accepted answer
  1. Jiang Zhang 786 Reputation points
    2021-06-16T12:49:35.66+00:00

    Hi,

    As far as I know, there may be a way you could fix it. You may try changing configuration of the default SSH shell from bash.exe to powershell.exe if you could apply in your system.

    The following link is how you configure the default SSH shell for your reference.

    https://www.programmersought.com/article/51663219762/

    Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.

    Best Regards,
    Mulder Zhang

    --------------------------------------------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.