305 
SCP file transfer with password authentication 
Network requirements 
As shown in Figure 100, you can log in to Switch B through the SCP client that runs on Switch A. After 
login, you are assigned the user role network-admin and can securely transfer files with Switch B. Switch 
B uses the password authentication method and the client 's username and password are saved on 
Switch B. 
Figure 100 Network diagram 
 
 
Configuration procedure 
1.  Configure the SCP server: 
# Generate RSA key pairs. 
<SwitchB> system-view 
[SwitchB] public-key local create rsa 
The range of public key size is (512 ~ 2048). 
If the key modulus is greater than 512, it will take a few minutes. 
Press CTRL+C to abort. 
Input the modulus length [default = 1024]: 
Generating Keys... 
........................++++++ 
...................++++++ 
..++++++++ 
............++++++++ 
Create the key pair successfully. 
# Generate a DSA key pair. 
[SwitchB] public-key local create dsa 
The range of public key size is (512 ~ 2048). 
If the key modulus is greater than 512, it will take a few minutes. 
Press CTRL+C to abort. 
Input the modulus length [default = 1024]: 
Generating Keys... 
.++++++++++++++++++++++++++++++++++++++++++++++++++* 
........+......+.....+......................................+ 
...+.................+..........+...+. 
Create the key pair successfully. 
# Enable the SSH server function. 
[SwitchB] ssh server enable 
# Configure an IP address for VLAN-interface 2. The SCP client uses this address as the destination 
for SCP connection.  
[SwitchB] interface vlan-interface 2 
[SwitchB-Vlan-interface2] ip address 192.168.0.1 255.255.255.0 
[SwitchB-Vlan-interface2] quit