Error: "Cannot initialize SFTP protocol. Is the host running a SFTP server?"

4196 views
Skip to first unread message

Michael Favor

unread,
Mar 24, 2004, 8:05:22 PM3/24/04
to
Greetings,

I installed Openssh on a couple of Windows 2000 servers with cygwin, using
instructions I found on this web page:

http://pigtail.net/LRP/printsrv/cygwin-sshd.html

That worked fine on some servers, but on one I get an error when I try to
connect to it that says:

"Cannot initialize SFTP protocol. Is the host running a SFTP server?"
and
"Connection has been unexpectedly closed. Server sent command exit
status 1."

The authentication part seems to be working fine, it's only the SFTP part
that doesn't seem to be working. Any suggestions for how to troubleshoot
this would be greatly appreciated.

regards,
michael.


Carlo Luciano Bianco

unread,
Mar 25, 2004, 6:48:38 PM3/25/04
to
"Michael Favor" <no-...@example.com> wrote in
news:mfq8c.42369$ys7....@newssvr25.news.prodigy.com:

> That worked fine on some servers, but on one I get an error when I try
> to connect to it that says:
>
> "Cannot initialize SFTP protocol. Is the host running a SFTP
> server?"
> and
> "Connection has been unexpectedly closed. Server sent command exit
> status 1."
>
> The authentication part seems to be working fine, it's only the SFTP
> part that doesn't seem to be working. Any suggestions for how to
> troubleshoot this would be greatly appreciated.

Such a problem may happen if the server sends "extra" messages after the
login, e.g. warning you that the password is expiring in 2 weeks. If you
connect to that server with an interactive shell, what do you see after
the login? Are there differences with what you see on a server where SFTP
works?

--
| Carlo Luciano Bianco | ICQ UIN: 109517158 |
|______________________| Home page: <http://web.tiscali.it/clbianco/> |
|GPG DSA/ElG 1024/4096:|_________________________________________________|
|KeyID:0x5324A0DA - Fingerprint:8B00C61034120506111B143DEDBF71B45324A0DA |

Darren Tucker

unread,
Mar 25, 2004, 8:19:18 PM3/25/04
to
In article <mfq8c.42369$ys7....@newssvr25.news.prodigy.com>,

Michael Favor <no-...@example.com> wrote:
>I installed Openssh on a couple of Windows 2000 servers with cygwin, using
>instructions I found on this web page:
[...]

>That worked fine on some servers, but on one I get an error when I try to
>connect to it that says:
>
> "Cannot initialize SFTP protocol. Is the host running a SFTP server?"
>and
> "Connection has been unexpectedly closed. Server sent command exit
>status 1."

Sound like the sftp subsystem settings in sshd_config are wrong. Look for
Subsystem sftp /path/to/sftp-server in sshd_config, make sure the path is
right and sftp-server exists and is executable.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Nico Kadel-Garcia

unread,
Mar 26, 2004, 9:02:33 AM3/26/04
to

"Darren Tucker" <dtu...@dodgy.net.au> wrote in message
news:c400em$o7n$1...@gate.dodgy.net.au...

> In article <mfq8c.42369$ys7....@newssvr25.news.prodigy.com>,
> Michael Favor <no-...@example.com> wrote:
> >I installed Openssh on a couple of Windows 2000 servers with cygwin,
using
> >instructions I found on this web page:
> [...]
> >That worked fine on some servers, but on one I get an error when I try to
> >connect to it that says:
> >
> > "Cannot initialize SFTP protocol. Is the host running a SFTP
server?"
> >and
> > "Connection has been unexpectedly closed. Server sent command exit
> >status 1."
>
> Sound like the sftp subsystem settings in sshd_config are wrong. Look for
> Subsystem sftp /path/to/sftp-server in sshd_config, make sure the path is
> right and sftp-server exists and is executable.

And why are you using sftp? Wouldn't you be better off with scp, or with an
"rsync -e ssh" combination?


Michael Favor

unread,
Mar 26, 2004, 2:02:53 PM3/26/04
to

"Carlo Luciano Bianco" <clbi...@tiscalinet.it> wrote in message
news:Xns94B870319C35cl...@127.0.0.1...

> "Michael Favor" <no-...@example.com> wrote in
> news:mfq8c.42369$ys7....@newssvr25.news.prodigy.com:
>
> > That worked fine on some servers, but on one I get an error when I try
> > to connect to it that says:
> >
> > "Cannot initialize SFTP protocol. Is the host running a SFTP
> > server?"
> > and
> > "Connection has been unexpectedly closed. Server sent command exit
> > status 1."
> >
> > The authentication part seems to be working fine, it's only the SFTP
> > part that doesn't seem to be working. Any suggestions for how to
> > troubleshoot this would be greatly appreciated.
>
> Such a problem may happen if the server sends "extra" messages after the
> login, e.g. warning you that the password is expiring in 2 weeks. If you
> connect to that server with an interactive shell, what do you see after
> the login? Are there differences with what you see on a server where SFTP
> works?

This was an excellent suggestion. I had been using the very nice WinSCP
client, but when I connected to the remote host by using the "SSH" command
from the CYGWIN command prompt, I was able to see right away what the
problem was. Those "extra" messages provided just the information I
needed.

Thanks for the hint, Carlo!

regards,
michael.


Carlo Luciano Bianco

unread,
Mar 28, 2004, 6:10:24 AM3/28/04
to
"Michael Favor" <no-...@example.com> wrote in
news:x7%8c.43069$hb.3...@newssvr25.news.prodigy.com:

> "Carlo Luciano Bianco" <clbi...@tiscalinet.it> wrote in message
> news:Xns94B870319C35cl...@127.0.0.1...

>> Such a problem may happen if the server sends "extra" messages after
>> the login, e.g. warning you that the password is expiring in 2 weeks.
>> If you connect to that server with an interactive shell, what do you
>> see after the login? Are there differences with what you see on a
>> server where SFTP works?
>
> This was an excellent suggestion. I had been using the very nice WinSCP
> client,

Me too, that's why I get your same error message one time every 6 months
(which is my password lifetime)... ;-)

> but when I connected to the remote host by using the "SSH"
> command from the CYGWIN command prompt, I was able to see right away
> what the problem was. Those "extra" messages provided just the
> information I needed.
>
> Thanks for the hint, Carlo!

I'm glad it was helpful, Michael!

Иван Семин

unread,
Apr 30, 2021, 3:05:24 PM4/30/21
to
Hello everyone, sorry if I bring up this topic, for two days I could not get the same on my vcenter server, having root rights I received the error "Cannot initialize SFTP protocol. Is the host running an SFTP server". For me, everything was decided by enabling bash for the account, maybe this will help someone, found the information here (http://pyatilistnik.org/cannot-initialize-sftp-protocol/).
Reply all
Reply to author
Forward
0 new messages