为什么我无法sftp进入华为交换机

网络工程 转变 华为
2022-02-19 01:12:11

我有HUAWEI S2300 Switch,这是我的配置:

[HUAWEI-A]dis current-configuration
#
!Software Version V100R005C01
 sysname HUAWEI-A
#
 FTP server enable
#
 vlan batch 1 to 4 7 to 8
#
 cluster enable
 ntdp enable
 ntdp hop 16
 ndp enable
#
 dhcp enable
#
 undo http server enable
#
aaa
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default
 domain default_admin
 local-user admin password cipher !F&43ULTPTE*61\PR4!PYA!!
 local-user admin privilege level 3
 local-user admin service-type ftp
 local-user huawei password cipher N`C55QK<`=/Q=^Q`MAF4<1!!
 local-user huawei privilege level 3
 local-user huawei service-type ssh
 local-user root password cipher WY$\*-[*C3%*61\PR4!PYA!!
 local-user root privilege level 3
 local-user root service-type telnet ssh
#
interface Vlanif1
 ip address dhcp-alloc
#
interface Vlanif2
 ip address 10.10.11.32 255.255.255.0
#
...

#
 snmp-agent
 snmp-agent local-engineid 000007DB7F00000100006136
 snmp-agent sys-info version v3
#
 sftp server enable
 stelnet server enable
 ssh user admin
 ssh user huawei
 ssh user admin authentication-type password
 ssh user huawei authentication-type password
 ssh user admin service-type stelnet
 ssh user huawei service-type stelnet
#
user-interface maximum-vty 15
user-interface con 0
user-interface vty 0 4
 authentication-mode aaa
 protocol inbound ssh
user-interface vty 5 14
 authentication-mode aaa
#

你看我已经创建了一个huawei用户使用ssh,我可以ssh登录成功使用huawei帐户,但是我不能sftp登录它。

这是我使用 filezilla 客户端的信息:

response:   fzSftp started, protocol_version=8
command:    open "huawei@10.10.11.32" 22
command:    Pass: ******
error:  Server sent disconnect message
error:  type 2 (protocol error):
error:  "The connection is closed by SSH server
error:  "
error:  cannot connect to server.

编辑-01

我添加了以下配置:

[Z306-LW-A-aaa]local-user huawei service-type telnet ssh ftp sftp
                                                             ^
Error:Too many parameters found at '^' position.
[Z306-LW-A-aaa]local-user huawei service-type telnet ssh ftp

那里只能加telnet ssh ftp,不能加sftp


编辑-02

无论我将 ftp 目录设置flash:flash:/

local-user huawei service-type telnet ssh ftp
local-user huawei ftp-directory flash:

当我使用 filezilla connect 时,总是会出现这个错误:

Status: Unsecure server, does not support FTP over TLS.
Status: The server does not support non-ASCII characters.
Status: Logged in
Status: Read directory listing...
Command: PWD
Response: 257 "flash:" is current directory.
Error: Unable to parse the returned path.
Error: Failed to read directory listing
1个回答

华为在大多数交换机型号上都支持SFTP 。分享您的完整型号。

PS:默认情况下,SFTP服务是关闭的。您需要启用它。

这里是完成SFTP的配置,可以看我的配置求助

#
 sysname SSH Server
#
aaa
 local-user client001 password cipher %$%$c|-D8KO4/,B[(FR.r!LHg]TK%$%$
 local-user client001 privilege level 15
 local-user client001 service-type ssh
#
sftp server enable
ssh user client001
ssh user client001 authentication-type password
ssh user client001 service-type sftp
ssh user client001 sftp-directory flash:
#
user-interface vty 0 4
 authentication-mode aaa
 protocol inbound ssh
#
return