In Figure 1, if the SFTP server function is enabled on the device working as the Secure Shell (SSH) server, the PC, which is the SFTP client, can connect to the SSH server after being authenticated in password, RSA, password-RSA, DSA, password-DSA, or all mode.
This example describes how to configure login to the SSH server in password mode.
Device Name |
Interface |
IP Address |
SSH Server |
GE0/1/1 |
10.137.217.225/16 |
SSH Server |
Loopback0 |
1.1.1.1/32 |
The configuration roadmap is as follows:
To complete the configuration, you need the following data:
<HUAWEI> system-view [~HUAWEI] sysname SSH Server [*HUAWEI] commit [~SSH Server] rsa local-key-pair create The key name will be: HUAWEI_Host The range of public key size is (2048, 3072). NOTE: Key pair generation will take a short while. Please input the modulus [default = 3072]:3072
[*SSH Server] aaa [*SSH Server-aaa] local-user client001 password Please configure the password (8-128) Enter Password: Confirm Password: Info: A new user is added. [*SSH Server-aaa] local-user client001 level 3 [*SSH Server-aaa] local-user client001 service-type ssh [*SSH Server-aaa] commit [~SSH Server-aaa] quit
[~SSH Server] interface loopback 0 [~SSH Server-LoopBack0] ip address 1.1.1.1 255.255.255.255 [*SSH Server-LoopBack0] quit [*SSH Server] sftp server enable [*SSH Server] ssh server-source -i loopback 0 [*SSH Server] ssh user client001 authentication-type password [*SSH Server] ssh user client001 service-type sftp [*SSH Server] commit
[~SSH Server] ssh user client001 sftp-directory cfcard: [*SSH Server] commit
Start the SFTP software on the client, and enter the user name, password, and port number (22 by default) to access the SSH server and transfer files.
# sysname SSH Server # aaa local-user client001 password irreversible-cipher $1a$jbB7=)5o.6$::j(W-#|XF&f6"M0>X**1bD0%2_"{4XX!lO="Sn0$ local-user client001 level 3 local-user client001 service-type ssh # interface GigabitEthernet0/1/1 undo shutdown ip address 10.137.217.225 255.255.0.0 # interface loopback 0 ip address 1.1.1.1 255.255.255.255 sftp server enable ssh server-source -i loopback 0 ssh user client001 ssh user client001 authentication-type password ssh user client001 service-type sftp ssh user client001 sftp-directory cfcard: # user-interface vty 0 4 authentication-mode aaa protocol inbound ssh # return