首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >winScp:连接意外关闭。服务器发送命令退出状态127

winScp:连接意外关闭。服务器发送命令退出状态127
EN

Ask Ubuntu用户
提问于 2019-01-22 07:43:56
回答 1查看 3.3K关注 0票数 1

我的服务器是Ubuntu14.04.5LTS,我可以通过SSH与PuTTY连接,但我不能通过WinSCP连接。

当我试图通过WinSCP连接时,它会给出错误:

连接意外关闭。服务器发送命令退出状态127

下面是一个日志文件

代码语言:javascript
复制
. 2019-01-23 15:40:22.694 --------------------------------------------------------------------------
. 2019-01-23 15:40:22.694 WinSCP Version 5.13.7 (Build 9125) (OS 6.1.7601 Service Pack 1 - Windows 7 Professional)
. 2019-01-23 15:40:22.694 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2019-01-23 15:40:22.695 Log level: Normal
. 2019-01-23 15:40:22.695 Local account: D146\Subhash
. 2019-01-23 15:40:22.695 Working directory: C:\Program Files (x86)\WinSCP
. 2019-01-23 15:40:22.695 Process ID: 6672
. 2019-01-23 15:40:22.696 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" 
. 2019-01-23 15:40:22.696 Time zone: Current: GMT+5:30 (India Standard Time), No DST
. 2019-01-23 15:40:22.696 Login time: 23 January 2019 PM 3:40:22
. 2019-01-23 15:40:22.696 --------------------------------------------------------------------------
. 2019-01-23 15:40:22.696 Session name: winscp testing (Site)
. 2019-01-23 15:40:22.696 Host name: 71.6.186.24 (Port: 22)
. 2019-01-23 15:40:22.697 User name: root (Password: Yes, Key file: No, Passphrase: No)
. 2019-01-23 15:40:22.697 Tunnel: No
. 2019-01-23 15:40:22.697 Transfer Protocol: SFTP
. 2019-01-23 15:40:22.697 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2019-01-23 15:40:22.697 Disable Nagle: No
. 2019-01-23 15:40:22.697 Proxy: None
. 2019-01-23 15:40:22.697 Send buffer: 262144
. 2019-01-23 15:40:22.697 SSH protocol version: 2; Compression: No
. 2019-01-23 15:40:22.697 Bypass authentication: No
. 2019-01-23 15:40:22.697 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: Yes
. 2019-01-23 15:40:22.697 GSSAPI: Forwarding: No; Libs: gssapi32,sspi,custom; Custom: 
. 2019-01-23 15:40:22.697 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2019-01-23 15:40:22.697 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2019-01-23 15:40:22.697 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2019-01-23 15:40:22.697 Simple channel: Yes
. 2019-01-23 15:40:22.697 Return code variable: Autodetect; Lookup user groups: Auto
. 2019-01-23 15:40:22.697 Shell: default
. 2019-01-23 15:40:22.697 EOL: LF, UTF: Auto
. 2019-01-23 15:40:22.697 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2019-01-23 15:40:22.697 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2019-01-23 15:40:22.697 SFTP Bugs: Auto,Auto
. 2019-01-23 15:40:22.697 SFTP Server: default
. 2019-01-23 15:40:22.698 Local directory: C:\Users\Subhash\Documents, Remote directory: /, Update: Yes, Cache: Yes
. 2019-01-23 15:40:22.698 Cache directory changes: Yes, Permanent: Yes
. 2019-01-23 15:40:22.698 Recycle bin: Delete to: No, Overwritten to: No, Bin path: 
. 2019-01-23 15:40:22.698 DST mode: Unix
. 2019-01-23 15:40:22.698 --------------------------------------------------------------------------
. 2019-01-23 15:40:22.722 Looking up host "71.6.186.24" for SSH connection
. 2019-01-23 15:40:22.722 Connecting to 71.6.186.24 port 22
. 2019-01-23 15:40:22.977 We claim version: SSH-2.0-WinSCP_release_5.13.7
. 2019-01-23 15:40:23.234 Server version: SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2
. 2019-01-23 15:40:23.235 We believe remote version has SSH-2 channel request bug
. 2019-01-23 15:40:23.235 Using SSH protocol version 2
. 2019-01-23 15:40:23.235 Have a known host key of type ecdsa-sha2-nistp256
. 2019-01-23 15:40:23.491 Doing ECDH key exchange with curve nistp256 and hash SHA-256
. 2019-01-23 15:40:23.822 Server also has ssh-dss/ssh-rsa host keys, but we don't know any of them
. 2019-01-23 15:40:23.822 Host key fingerprint is:
. 2019-01-23 15:40:23.822 ecdsa-sha2-nistp256 256 f0:39:24:5c:63:12:5a:0d:e3:35:08:3d:91:d2:9f:53 7HbkGPzNm6tuAiqUoEpiHX4jxoNzxJgXQjWOgjuKGM8=
. 2019-01-23 15:40:23.871 Host key matches cached key
. 2019-01-23 15:40:23.871 Initialised AES-256 SDCTR client->server encryption
. 2019-01-23 15:40:23.871 Initialised HMAC-SHA-256 client->server MAC algorithm
. 2019-01-23 15:40:23.871 Initialised AES-256 SDCTR server->client encryption
. 2019-01-23 15:40:23.871 Initialised HMAC-SHA-256 server->client MAC algorithm
! 2019-01-23 15:40:24.426 Using username "root".
. 2019-01-23 15:40:24.744 Server offered these authentication methods: publickey,password,keyboard-interactive
. 2019-01-23 15:40:24.745 Attempting keyboard-interactive authentication
. 2019-01-23 15:40:25.002 Server refused keyboard-interactive authentication
. 2019-01-23 15:40:25.002 Server offered these authentication methods: publickey,password,keyboard-interactive
. 2019-01-23 15:40:25.002 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2019-01-23 15:40:25.002 Using stored password.
. 2019-01-23 15:40:25.059 Sent password
. 2019-01-23 15:40:25.331 Access granted
. 2019-01-23 15:40:25.331 Opening session as main channel
. 2019-01-23 15:40:25.585 Opened main channel
. 2019-01-23 15:40:26.134 Started a shell/command
. 2019-01-23 15:40:26.148 --------------------------------------------------------------------------
. 2019-01-23 15:40:26.148 Using SFTP protocol.
. 2019-01-23 15:40:26.149 Doing startup conversation with host.
. 2019-01-23 15:40:26.149 Server sent command exit status 127
. 2019-01-23 15:40:26.150 Disconnected: All channels closed
* 2019-01-23 15:40:26.187 (EFatal) **Connection has been unexpectedly closed.** Server sent command exit status 127.
EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2019-01-24 13:04:02

若要从其他主机访问sftp,请确保安装和配置正确。

  • 安装的OpenSSH服务器
  • 配置sshd_config
    • PubkeyAuthentication是
    • 子系统sftp内部

  • 将您的公钥添加到~/..ssh/授权密钥中
  • 使用端口22/TCP打开的# /etc/init.d/sshd start启动ssh服务器
  • # iptables -I INPUT -j ACCEPT -p tcp --dport 22

最后,测试$ sftp <login>@<hostname>

票数 2
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1111873

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档