337
# Upload a local file named
pu
to the server, save it as
puk
, and check that 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 with the remote SFTP server.
sftp-client> quit
Bye
Connection closed.
<RouterA>
SFTP server configuration example
Network requirements
As shown in
, an SSH connection is required between the host and the router. The host, an
SFTP client, needs to log in to the router for file management and file transfer. Use password
authentication, and configure the username
client002
and the password
aabbcc
for the client on the
router.
Figure 117
Network diagram for SFTP server configuration
Configuration procedure
1.
Configure the SFTP server.
# Generate the RSA key pairs.
<Router> system-view
[Router] 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.
Input the bits of the modulus[default = 1024]:
Generating Keys...
++++++++