< Home

put (SFTP client view)

Function

The put command uploads a local file to a remote SFTP server.

Format

put local-filename [ remote-filename ]

Parameters

Parameter Description Value
local-filename Specifies a local file name on the SFTP client. The value is a case-insensitive character string without spaces. The file name (including the absolute path) contains 1 to 64 characters.
remote-filename Specifies the name of the file uploaded to the remote SFTP server. The value is a case-insensitive character string without spaces. The file name (including the absolute path) contains 1 to 64 characters.

Views

SFTP client view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

This command enables you to upload files from the local device to a remote SFTP server to view the file contents or back up the files. For example, you can upload log files of a device to an SFTP server and view the logs in the server. During an upgrade, you can upload the configuration file of the device to the SFTP server for backup.

Precautions

  • If remote-filename is not specified, the uploaded file is saved on the remote SFTP server with the original file name.

  • If the specified remote-filename is the same as an existing file name on the SFTP server, the uploaded file overwrites the existing file on the server.

The file system has a restriction on the number of files in the root directory. Therefore, if more than 50 files exist in the root directory, creating new files in this directory may fail.

Example

# Upload a file to the SFTP server.

<HUAWEI> system-view
[HUAWEI] sftp 10.137.217.201
Please input the username:admin
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Enter password:
sftp-client> put wm.cfg
local file: wm.cfg --->  Remote file: /wm.cfg
Info: Uploading file successfully ended.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >