Configuration procedure

  1. Configure the SCP server:

    # Generate RSA key pairs.

    <RouterB> system-view
    [RouterB] public-key local create rsa
    The range of public key modulus 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.

    [RouterB] public-key local create dsa
    The range of public key modulus 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 an ECDSA key pair.

    [RouterB] public-key local create ecdsa secp256r1
    Generating Keys...
    .
    Create the key pair successfully.
    

    # Enable the SCP server.

    [RouterB] scp server enable
    

    # Configure an IP address for GigabitEthernet 1/0/1. The client uses this address as the destination for SCP connection.

    [RouterB] interface gigabitethernet 1/0/1
    [RouterB-GigabitEthernet1/0/1] ip address 192.168.0.1 255.255.255.0
    [RouterB-GigabitEthernet1/0/1] quit
    

    # Create a local device management user named client001.

    [RouterB] local-user client001 class manage
    

    # Set the password to aabbcc in plain text for local user client001.

    [RouterB-luser-manage-client001] password simple aabbcc
    

    # Authorize local user client001 to use the SSH service.

    [RouterB-luser-manage-client001] service-type ssh
    

    # Assign the network-admin user role to local user client001.

    [RouterB-luser-manage-client001] authorization-attribute user-role network-admin
    [RouterB-luser-manage-client001] quit
    

    # Create an SSH user named client001. Specify the service type as scp and the authentication method password for the user.

    [RouterB] ssh user client001 service-type scp authentication-type password
    
  2. Configure an IP address for GigabitEthernet 1/0/1 on the SCP client.

    <RouterA> system-view
    [RouterA] interface gigabitethernet 1/0/1
    [RouterA-GigabitEthernet1/0/1] ip address 192.168.0.2 255.255.255.0
    [RouterA-GigabitEthernet1/0/1] quit
    [RouterA] quit
    
  3. Connect to the SCP server, download the file remote.bin from the server, and save it as a local file named local.bin.

    <RouterA> scp 192.168.0.1 get remote.bin local.bin
    Username: client001
    Press CTRL+C to abort.
    Connecting to 192.168.0.1 port 22.
    The server is not authenticated. Continue? [Y/N]:y
    Do you want to save the server public key? [Y/N]:n
    client001@192.168.0.1’s password:
    remote.bin                                       100% 2875     2.8KB/s   00:00