334
Remote file:/pubkey2 ---> Local file: public
Downloading file successfully ended
# Upload the local file
pu
to the server, save it as
puk
, and check if the file has been uploaded
successfully.
sftp-client> put pu puk
Local file:pu ---> Remote file: /puk
Uploading file successfully ended
sftp-client> dir
-rwxrwxrwx 1 noone nogroup 1759 Aug 23 06:52 config.cfg
-rwxrwxrwx 1 noone nogroup 225 Aug 24 08:01 pubkey2
-rwxrwxrwx 1 noone nogroup 283 Aug 24 07:39 pubkey
drwxrwxrwx 1 noone nogroup 0 Sep 01 06:22 new
drwxrwxrwx 1 noone nogroup 0 Sep 02 06:33 new2
-rwxrwxrwx 1 noone nogroup 283 Sep 02 06:35 pub
-rwxrwxrwx 1 noone nogroup 283 Sep 02 06:36 puk
sftp-client>
# Terminate the connection to the remote SFTP server.
sftp-client> quit
Bye
Connection closed.
<SwitchA>
SFTP server configuration example
Unless otherwise noted, devices in the configuration example are operating in non-FIPS mode.
Network requirements
As shown in
, an SSH connection is required between the host and the switch. The host, an
SFTP client, needs to log in to the switch for file management and file transfer. Use password
authentication and configure the username
client002
and the password
aabbcc
for the client on the
switch.
Figure 102
Network diagram
Configuration procedure
1.
Configure the SFTP server:
# Generate the RSA key pairs.
<Switch> system-view
[Switch] public-key local create rsa
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
It will take a few minutes.
Press CTRL+C to abort.