Unable to initialize SFTP. Is the host an SFTP server? WinSCP error

When I try to SSH into my cluster there are two steps. So I have to enter my password twice to go to my home directory using SSH in a Linux or PuTTY terminal.

But when I try to use WinSCP I get the following errors:

Trying SFTP:

Unable to initialize SFTP. Is the host an SFTP server?

SCP Attempt:

Missing startup message error. Your shell is probably not compatible with the application (BASH recommended).

How can I get around this problem?

+3


source to share


4 answers


For general information, read the documentation for the error message Unable to initialize SFTP. Is the host an SFTP server?

Although for your particular case, the problem is most likely caused by the server being unable to talk to WinSCP to exchange the second password. What is the second password for? sudo

? Or SSH tunnel to the second "stage" (whatever that is)?

For sudo

/ su

see WinSCP FAQ How to change user after login (eg su root)?



For tunneling see the tunneling documentation .

I know this is a little vague answer, but also your question. If you describe what the two passwords are for, and if you share a session log file, you might get better answers.

0


source


What you call the two types of passwords is called keyboard-interactive

you can turn it off easily



  • going to / etc / ssh / sshd_config
  • set ChallengeResponseAuthentication = false
  • then restart the ssh service with sshd service restart
0


source


Actually, this error can be misleading in some cases. Assuming SSH is working (which is the case for you), it might just be the fact that your bash is outputting some text that breaks the SCP.

Once you are using SSH on your system, is there some text? (Example of some welcome texts). If so, you can put the test in yours ~/.bashrc

(or some script the first time, for example ~/.bash_profile

on some systems) and check if the shell is interactive or not. If it's not interactive, don't print anything. You can use this to skip any print (put this at the beginning .bashrc

):

#Detect if in SCP
if [ -z "$PS1" ]; then
    return
fi

      

0


source


In Winscp, I just changed the File Protocol setting from SFTP to SCP , and now file transfer starts working.

enter image description here

0


source







All Articles