Google 网上论坛不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

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

已查看 5,888 次
跳至第一个未读帖子

Michael Favor

未读,
2004年3月24日 20:05:222004/3/24
收件人
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

未读,
2004年3月25日 18:48:382004/3/25
收件人
"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

未读,
2004年3月25日 20:19:182004/3/25
收件人
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

未读,
2004年3月26日 09:02:332004/3/26
收件人

"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

未读,
2004年3月26日 14:02:532004/3/26
收件人

"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

未读,
2004年3月28日 06:10:242004/3/28
收件人
"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!

Иван Семин

未读,
2021年4月30日 15:05:242021/4/30
收件人
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/).
0 个新帖子