H3C WX3000 Series Unified Switches Switching Engine Command Reference-6W103

HomeSupportWirelessH3C WX3000 Series Unified SwitchesReference GuidesCommand ReferencesH3C WX3000 Series Unified Switches Switching Engine Command Reference-6W103
29-FTP-SFTP-TFTP Command
Title Size Download
29-FTP-SFTP-TFTP Command 172.8 KB

FTP and SFTP Configuration Commands

FTP Server Configuration Commands

display ftp-server

Syntax

display ftp-server

View

Any view

Parameters

None

Description

Use the display ftp-server command to display the FTP server-related settings of the device when it operates as an FTP server.

You can use this command to verify FTP server-related configurations.

Examples

# Display the FTP server-related settings of the device (FTP must be enabled).

<device> display ftp-server

   FTP server is running

   Max user number       1

   User count            0

   Timeout value(in minute)       30

Table 1-1 display ftp-server command output description

Field

Description

FTP server is running

The FTP server is started.

Max user number       1

The FTP server can accommodate up to one user.

User count                 0

The current login user number is 0.

Timeout value (in minute)       30

The connection idle time is 30 minutes.

 

display ftp-server source-ip

Syntax

display ftp-server source-ip

View

Any view

Parameters

None

Description

Use the display ftp-server source-ip command to display the source IP address set for an FTP server. If a source interface is specified for the FTP server, the IP address of the source interface will be displayed. If neither source interface nor source IP address is specified, 0.0.0.0 will be displayed.

Examples

# Display the source IP address set for the FTP server.

<device> display ftp-server source-ip

The source IP you specified is 192.168.0.1

display ftp-user

Syntax

display ftp-user

View

Any view

Parameters

None

Description

Use the display ftp-user command to display the settings of the current FTP user, including the user name, host IP address, port number, connection idle time, and authorized directory.

Examples

# Display FTP user settings.

<device> display ftp-user

  UserName             HostIP    Port    Idle              HomeDir

admin           192.168.0.152    1029       0               flash:

# If the user name exceeds ten characters, characters behind the tenth will be displayed in the second line with a left-aligning mode. Take username username@test for example, the result is:

<device> display ftp-user

  UserName             HostIP    Port    Idle              HomeDir

administrator   192.168.0.152    1031    0                 flash:

ftp disconnect

Syntax

ftp disconnect user-name

View

System view

Parameters

user-name: Name of the user to be disconnected from the FTP server. Note that the host name can be a string comprising 1 to 184 characters.

Description

Use the ftp disconnect command to terminate the connection between a specified user and the FTP server.

 

With the device acting as the FTP server, if you attempt to disconnect a user that is uploading/downloading data to/from the FTP server, the device will disconnect the user after the data transmission is completed.

 

Examples

# Display the current online FTP users.

<device> display ftp-user

  UserName             HostIP    Port    Idle              HomeDir

admin           192.168.0.152    1029       0               flash:

# Disconnect the user named “admin” from the FTP server.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] ftp disconnect admin

%Apr  2 01:06:14:915 2000 device FTPS/5/USEROUT:- 1 -User admin(192.168.0.152) logged out

ftp server enable

Syntax

ftp sever enable

undo ftp sever

View

System view

Parameters

None

Description

Use the ftp server enable command to enable the FTP server for users to log in.

Use the undo ftp server command to disable the FTP server.

By default, the FTP server is disabled to avoid potential security risks.

 

To protect unused sockets from being attacked by malicious users, the device provides the following functions:

l          TCP 21 is enabled only when you start the FTP server.

l          TCP 21 is disabled after you shut down the FTP server.

 

Examples

# Enable the FTP server.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] ftp server enable

% Start FTP server

ftp timeout

Syntax

ftp timeout minutes

undo ftp timeout

View

System view

Parameters

minutes: Connection idle time (in minutes) in the range 1 to 35,791.

Description

Use the ftp timeout command to set the connection idle time.

Use the undo ftp timeout command to restore the default connection idle time.

By default, the connection idle time is 30 minutes.

If an FTP connection between an FTP server and an FTP client breaks down abnormally, the FTP server is not acknowledged with this and will keep this connection as usual.

You can set a connection idle time, so that the FTP server considers a FTP connection to be invalid and terminates it if no data exchange occurs on it in a specific period known as connection idle time.

Examples

# Set the connection idle time to 36 minutes.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] ftp timeout 36

ftp-server source-interface

Syntax

ftp-server source-interface interface-type interface-number

undo ftp-server source-interface

View

System view

Parameters

interface-type: Type of the source interface.

interface-number: Number of the source interface.

Description

Use the ftp-server source-interface command to specify the source interface for an FTP server. If the specified interface does not exist, a prompt appears to show the configuration fails.

Use the undo ftp-server source-interface command to cancel the source interface setting. After you execute this command, the FTP server system decides which interface will be used for being accessed by FTP clients.

Examples

# Specify Vlan interface1 as the source interface of the FTP server.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] ftp-server source-interface Vlan-interface 1 

ftp-server source-ip

Syntax

ftp-server source-ip ip-address

undo ftp-server source-ip

View

System view

Parameters

ip-address: IP address that is to be specified as the source IP address.

Description

Use the ftp-server source-ip command to specify the source IP address for an FTP server. The value of argument ip-address must be an IP address on the device where the configuration is performed. Otherwise, a prompt appears to show the configuration fails.

Use the undo ftp-server source-ip command to cancel the source IP address setting. After you execute this command, the FTP server system decides which IP address on it will be used for being accessed by FTP clients.

Examples

# Specify 192.168.1.1 as the source IP address of the FTP server.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] ftp-server source-ip 192.168.1.1

FTP Client Configuration Commands

ascii

Syntax

ascii

View

FTP client view

Parameters

None

Description

Use the ascii command to specify that files be transferred in ASCII mode. That is, data is transferred in ASCII characters.

By default, files are transferred in ASCII mode.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Specify to transfer text files in ASCII mode.

[ftp] ascii

200 Type set to A.

binary

Syntax

binary

View

FTP client view

Parameters

None

Description

Use the binary command to specify that program files be transferred in binary mode.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Specify to transfer files in binary mode.

[ftp] binary

200 Type set to I.

bye

Syntax

bye

View

FTP client view

Parameters

None

Description

Use the bye command to terminate the control connection and data connection with the remote FTP server and return to user view.

This command has the same effect as that of the quit command.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Terminate the connections with the remote FTP server and return to user view.

[ftp] bye

221 Service closing control connection

<device>

cd

Syntax

cd pathname

View

FTP client view

Parameters

pathname: Path name

Description

Use the cd command to change the working directory on the remote FTP server.

Note that you can use this command to enter only authorized directories.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Change the working directory to flash:/temp.

[ftp] cd flash:/temp

# Display the current working directory.

[ftp] pwd

257 "flash:/temp" is current directory.

cdup

Syntax

cdup

View

FTP client view

Parameters

None

Description

Use the cdup command to exit the current working directory and enter the parent directory.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Change the working directory to flash:/temp.

[ftp] cd flash:/temp

250 CWD command successful

# Change the working directory to the parent directory.

[ftp] cdup

# Display the current directory.

[ftp] pwd

257 "flash:" is current directory.

close

Syntax

close

View

FTP client view

Parameters

None

Description

Use the close command to terminate an FTP connection without quitting FTP client view.

This command has the same effect as that of the disconnect command.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Terminate the FTP connection without quitting FTP client view.

[ftp] close

221 Server closing.

[ftp]

delete

Syntax

delete remotefile

View

FTP client view

Parameters

remotefile: File name

Description

Use the delete command to delete a specified remote file.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Delete the file named temp.c.

[ftp] delete temp.c

250 DELE command successful.

dir

Syntax

dir [ filename [ localfile ] ]

View

FTP client view

Parameters

filename: Name of the file to be queried.

localfile: Name of the local file where the query result is to be saved.

Description

Use the dir command to query specified files on a remote FTP server, or to display file information in the current directory. The output information, which includes the name, size and creation time of files, will be saved in a local file.

If you do not specify the filename argument, the information about all the files in the current directory is displayed.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Display the information about all the files in the current directory on the remote FTP server.

[ftp] dir

227 Entering Passive Mode (192,168,0,152,4,0).

125 ASCII mode data connection already open, transfer starting for *.

-rwxrwxrwx   1 noone    nogroup      2833 May 11 17:58 config.cfg

-rwxrwxrwx   1 noone    nogroup    225295 Apr 26 12:21 default.diag

drwxrwxrwx   1 noone    nogroup         0 Apr 28 11:41 test

-rwxrwxrwx   1 noone    nogroup      2145 Apr 28 13:13 test.txt

-rwxrwxrwx   1 noone    nogroup        13 Apr 28 13:21 mytest.bak

-rwxrwxrwx   1 noone    nogroup         9 Apr 28 13:24 a.txt

-rwxrwxrwx   1 noone    nogroup       142 Sep 10  2006 myopenssh

-rwxrwxrwx   1 noone    nogroup        15 Apr 26 17:45 public

-rwxrwxrwx   1 noone    nogroup        15 Apr 26 17:56 temp.c

-rwxrwxrwx   1 noone    nogroup       306 May 13 11:17 swithc001

226 Transfer complete.

FTP: 1025 byte(s) received in 0.019 second(s) 53.00K byte(s)/sec.

# Display the information about the file named config.cfg and save the output information in the file named temp1.

[ftp] dir config.cfg temp1

227 Entering Passive Mode (192,168,0,152,4,3).

125 ASCII mode data connection already open, transfer starting for config.cfg.

.....226 Transfer complete.

FTP: 67 byte(s) received in 5.818 second(s) 11.00 byte(s)/sec.

disconnect

Syntax

disconnect

View

FTP client view

Parameters

None

Description

Use the disconnect command to terminate a FTP connection without quitting FTP client view.

This command has the same effect as that of the close command.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Terminate the FTP connection without quitting FTP client view.

[ftp] disconnect

221 Server closing.

[ftp]

display ftp source-ip

Syntax

display ftp source-ip

View

Any view

Parameters

None

Description

Use the display ftp source-ip command to display the source IP address that the FTP client uses every time it connects to an FTP server. If a source interface is specified for the FTP client, the IP address of the source interface will be displayed. If neither a source IP address nor source interface is specified for the FTP client, 0.0.0.0 will be displayed.

Examples

# Display the source IP address that the FTP client uses every time it connects to an FTP server.

<device> display ftp source-ip

The source IP you specified is 192.168.0.1

ftp

Syntax

ftp [ cluster | remote-server [ port-number ] ]

View

User view

Parameters

cluster: FTP server of a cluster.

ip-address: Host name or the IP address of an FTP server. Note that the host name can be a string comprising 1 to 20 characters.

port-number: Port number of the FTP server, in the range 0 to 65535. The default is 21.

Description

Use the ftp command to establish a control connection with an FTP server and enter FTP client view.

Examples

# Connect to the FTP server whose IP address is 2.2.2.2.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

ftp { cluster | remote-server } source-interface

Syntax

ftp { cluster | remote-server } source-interface interface-type interface-number

View

User view

Parameters

cluster: Specifies to connect to a cluster FTP server.

remote-server: IP address or host name of the FTP server.

interface-type: Type of the source interface.

interface-number: Number of the source interface.

Description

Use the ftp { cluster | remote-server } source-interface command to connect to an FTP server through the specified source interface. This command will fail to be executed if the specified interface does not exist.

Examples

# Connect to the FTP server whose IP address is 192.168.8.8 through the source interface Vlan interface1.

<device> ftp 192.168.8.8 source-interface Vlan-interface 1

ftp { cluster | remote-server } source-ip

Syntax

ftp { cluster | remote-server } source-ip ip-address

View

User view

Parameters

cluster: Specifies to connect to a cluster FTP server.

remote-server: IP address or host name of the FTP server.

ip-address: Source IP address.

Description

Use the ftp { cluster | remote-server } source-ip command to connect to an FTP server through the specified source IP address. This command will fail to be executed if the specified source IP address does not exist.

Examples

# Connect to the FTP server whose IP address is 192.168.8.8 through the source IP address 192.168.0.1.

<device> ftp 192.168.8.8 source-ip 192.168.0.1

ftp source-interface

Syntax

ftp source-interface interface-type interface-number

undo ftp source-interface

View

System view

Parameters

interface-type: Type of the source interface.

interface-number: Number of the source interface.

Description

Use the ftp source-interface command to specify a source interface as the source interface the FTP client uses every time it connects to an FTP server. The system prompts that the configuration fails if the specified interface does not exist.

Use the undo ftp source-interface command to cancel the source interface setting. After you execute this command, the FTP client system decides which interface will be used for accessing FTP servers.

Examples

# Specify Vlan interface1 as the source interface to be used in each connection between the FTP client and an FTP server.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] ftp source-interface Vlan-interface 1 

ftp source-ip

Syntax

ftp source-ip ip-address

undo ftp source-ip

View

System view

Parameters

ip-address: IP address that is to be specified as the source IP address.

Description

Use the ftp source-ip command to specify the source IP address of an FTP client that the FTP client uses every time it connects to an FTP server. The value of argument ip-address must be an IP address on the device where the configuration is performed. Otherwise, a prompt appears to show the configuration fails.

Use the undo ftp source-ip command to cancel the source IP address setting. After you execute this command, the FTP client system decides which IP address on it will be used for accessing FTP servers.

Examples

# Specify 192.168.0.1 as the source IP address that the FTP client uses every time it connects to an FTP server.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] ftp source-ip 192.168.0.1

get

Syntax

get remotefile [ localfile ]

View

FTP client view

Parameters

remotefile: Name of a file on an FTP server.

localfile: Name of a local file.

Description

Use the get command to download a remote file and save it as a local file.

If you do not specify the localfile argument, the downloaded file is saved with its original name.

 

When using the get command to download files from a remote FTP server, note to limit the length of file path and file name within the following ranges regulated for the device.

l          A directory name should be no more than 91 characters.

l          A file name plus its local path name should be no more than 127 characters.

l          A device name should be no more than 14 characters.

l          A file name plus its complete path name should be no more than 142 characters.

 

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Download the file named temp.c.

[ftp] get temp.c

227 Entering Passive Mode (2,2,2,2,4,12).

125 ASCII mode data connection already open, transfer starting for temp.c.

..226 Transfer complete.

FTP: 15 byte(s) received in 2.568 second(s) 0.00 byte(s)/sec.

lcd

Syntax

lcd

View

FTP client view

Parameters

None

Description

Use the lcd command to display the local working directory on the FTP client.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Display the local working directory.

[ftp] lcd

% Local directory now flash:/temp

ls

Syntax

ls [ remotefile [ localfile ] ]

View

FTP client view

Parameters

remotefile: Name of the remote file to be queried.

localfile: Name of the local file where the querying result is to be saved.

Description

Use the ls command to display the information about a specified file on a remote FTP server.

If you do not specify the remotefile argument, names of all the files in the current remote directory are displayed.

 

The ls command only displays file names, while the dir command displays file information in more detail, including file size, creation date and so on.

 

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Display the names of all the files in the current directory on the remote FTP server.

[ftp] ls

227 Entering Passive Mode (2,2,2,2,4,4).

125 ASCII mode data connection already open, transfer starting for *.

config.cfg

default.diag

test

test.txt

mytest.bak

a.txt

myopenssh

public

temp.c

swithc001

226 Transfer complete.

FTP: 200 byte(s) received in 0.145 second(s) 1.00Kbyte(s)/sec.

mkdir

Syntax

mkdir pathname

View

FTP client view

Parameters

pathname: Path name.

Description

Use the mkdir command to create a directory on an FTP server.

This command is available only to the FTP clients that are assigned the permission to create directories on FTP servers.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Create the directory flash:/lanswitch on the FTP server.

[ftp] mkdir flash:/lanswitch

257 "flash:/ lanswitch" new directory created.

open

Syntax

open { ip-address | server-name } [ port ]

View

FTP client view

Parameters

ip-address: IP address of an FTP server.

server-name: Host name of the FTP server, a string of 1 to 20 characters.

port: Port number on the remote FTP server, in the range 0 to 65535. The default value is 21.

Description

Use the open command to establish a control connection with an FTP server.

Related commands: close.

Examples

# Enter FTP client view.

<device> ftp

[ftp]

# Establish a control connection with the FTP server whose IP address is 1.1.1.1.

[ftp]open 1.1.1.1

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):abc

331 Password required for abc

Password:

230 User logged in.

passive

Syntax

passive

undo passive

View

FTP client view

Parameters

None

Description

Use the passive command to set the data transfer mode to the passive mode.

Use the undo passive command to set the data transfer mode to the active mode.

By default, the passive mode is adopted.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Set the data transfer mode to the passive mode.

[ftp] passive

% Passive is on

put

Syntax

put localfile [ remotefile ]

View

FTP client view

Parameters

localfile: Name of a local file.

remotefile: File name, which the local file is to be saved as on the remote FTP server.

Description

Use the put command to upload a local file to an FTP server.

If you do not specify the remotefile argument, the local file is saved on the FTP server with its original name.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Upload the local file named temp.c to the FTP server.

[ftp] put temp.c

227 Entering Passive Mode (2,2,2,2,4,13).

125 ASCII mode data connection already open, transfer starting for temp.c.

226 Transfer complete.

FTP: 15 byte(s) sent in 7.549 second(s) 1.00byte(s)/sec.

pwd

Syntax

pwd

View

FTP client view

Parameters

None

Description

Use the pwd command to display the work directory on an FTP server.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Display the work directory on the FTP server.

[ftp] pwd

257 "flash:/temp" is current directory.

quit

Syntax

quit

View

FTP client view

Parameters

None

Description

Use the quit command to terminate FTP control connection and FTP data connection and quit to user view.

This command has the same effect as that of the bye command.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Terminate the FTP control connection and FTP data connection and quit to user view.

[ftp] quit

221 Server closing.

<device>

remotehelp

Syntax

remotehelp [ protocol-command ]

View

FTP client view

Parameters

protocol-command: FTP protocol command.

Description

Use the remotehelp command to display the help information about an FTP protocol command.

This command works only when the FTP server provides the help information about FTP protocol commands.

 

l          This command is always valid when a device operates as the FTP server.

l          If you use other FTP server software, refer to related instructions to know whether the FTP server provides help information about FTP protocol commands.

 

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Display the syntax of the user command.

[ftp]remotehelp user

214-USER Enter user name

PASS     Send Password

CWD      Change working directory

CDUP     Go to parent directory

QUIT     Exit FTP server

REIN     Reinitialize server

PORT     Set port for data transfer

TYPE     Set file transfer type

STRU     Set file transfer structure

MODE     Set file transfer mode

RETR     Retrieve file

STOR     Store file

APPE     Append to existing file

REST     Restart file transfer

RNFR     Rename from

RNTO     Rename to

ABOR     Abort transfer

DELE     Delete file

RMD      Remove directory

rename

Syntax

rename remote-source remote-dest

View

FTP client view

Parameters

remote-source: Name of a file on a remote host.

remote-dest: Destination file name.

Description

Use the rename command to rename a file on a remote FTP server.

If the destination file name conflicts with the name of an existing file or directory, you will fail to rename the file.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Rename the file named temp.c as forever.c.

[ftp] rename temp.c forever.c

350 Requested file action pending further information

250 Requested file action OK, completed

rmdir

Syntax

rmdir pathname

View

FTP client view

Parameters

pathname: Name of a directory on an FTP server.

Description

Use the rmdir command to remove a specified directory on an FTP server.

Note that you can only use this command to remove directories that are empty.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Remove the directory flash:/temp1 on the FTP server. (Assume that the directory is empty.)

[ftp] rmdir flash:/temp1

250 Requested file action OK, completed

user

Syntax

user username [ password ]

View

FTP client view

Parameters

username: User name used to log in to an FTP server.

password: Password used to log in to an FTP server.

Description

Use the user command to log in to an FTP server with the specified user name and password.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Log into the FTP server using the user account with the user name being tom and the password being 111.

[ftp] user tom 111

331 User name ok, need password

230 User logged in

verbose

Syntax

verbose

undo verbose

View

FTP client view

Parameters

None

Description

Use the verbose command to enable the verbose function, which displays execution and response information of other related commands.

Use the undo verbose command to disable the verbose function.

The verbose function is enabled by default.

Examples

# Enter FTP client view.

<device> ftp 2.2.2.2

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):admin

331 Password required for admin.

Password:

230 User logged in.

[ftp]

# Enable the verbose function.

[ftp] verbose

SFTP Server Configuration Commands

sftp server enable

Syntax

sftp server enable

undo sftp server

View

System view

Parameters

None

Description

Use the sftp server enable command to enable the SFTP server.

Use the undo sftp server command to disable the SFTP server.

By default, the SFTP server is disabled.

Examples

# Enable the SFTP server.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] sftp server enable

sftp timeout

Syntax

sftp timeout time-out-value

undo sftp timeout

View

System view

Parameters

time-out-value: Timeout time, in the range 1 to 35,791, in minutes. The default value is 10.

Description

Use the sftp timeout command to set the idle timeout time on an SFTP server.

Use the undo sftp timeout command to restore the idle timeout time to the default value.

If the idle timeout time exceeds the specified threshold, the system disconnects the SFTP user automatically.

Examples

# Set the idle timeout time to 500 minutes.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] sftp timeout 500

SFTP Client Configuration Commands

bye

Syntax

bye

View

SFTP client view

Parameters

None

Description

Use the bye command to terminate a connection with the remote SFTP server and return to system view.

This command has the same effect as that of the commands exit and quit.

Examples

# Terminate the connection with the remote SFTP server.

sftp-client> bye

Bye

[device]

cd

Syntax

cd [ remote-path ]

View

SFTP client view

Parameters

remote-path: Name of the working path on the remote server.

Description

Use the cd command to change the working path on the remote SFTP server. If no remote path is specified, this command displays the current working path.

 

l          Use the cd .. command to return to the parent directory.

l          Use the cd / command to return to the root directory.

 

Examples

# Change the working path to new1.

sftp-client>cd new1

Received status: Success

Current Directory is:

/new1

sftp-client>

cdup

Syntax

cdup

View

SFTP client view

Parameters

None

Description

Use the cdup command to change the working path on the remote SFTP server and return to the parent directory.

Examples

# Change the working path and return to the parent directory.

sftp-client>cdup

Received status: Success

Current Directory is:

/

delete

Syntax

delete remote-file&<1-10>

View

SFTP client view

Parameters

remote-file&<1-10>: Name of a file on the server. &<1-10> indicates that up to ten file names can be input. These file names should be separated by spaces.

Description

Use the delete command to delete a specified file from the remote SFTP server.

This command has the same effect as that of the remove command.

Examples

# Delete the file named test.txt on the server.

sftp-client> delete test.txt

The following files will be deleted:

/test.txt

Are you sure to delete it?(Y/N):y

This operation may take a long time.Please wait...

 

Received status: Success

File successfully Removed

dir

Syntax

dir [ -a | -l ] [ remote-path ]

View

SFTP client view

Parameters

-a: Displays the file and folder names in a specified directory.

-l: Displays the details about files and folders in a specified directory in a list.

remote-path: Name of the path where the file and folders to be queried reside.

Description

Use the dir command to query a specified directory on the remote SFTP server.

If -a or -l is not specified, the command displays details about the files and folders in the specified directory in a list.

If no remote path is specified, this command displays the files in the current working directory.

This command has the same effect as that of the Is command.

Examples

# Display the files in the current directory.

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 pubkey1

-rwxrwxrwx   1 noone    nogroup       225 Sep 28 08:28 pub1

drwxrwxrwx   1 noone    nogroup         0 Sep 28 08:24 new1

drwxrwxrwx   1 noone    nogroup         0 Sep 28 08:18 new2

-rwxrwxrwx   1 noone    nogroup       225 Sep 28 08:30 pub2

Received status: End of file

Received status: Success

display sftp source-ip

Syntax

display sftp source-ip

View

Any view

Parameters

None

Description

Use the display sftp source-ip command to display the source IP address specified for the current SFTP client.

If you have specified a source interface for the SFTP client, this command displays the IP address of the source interface; otherwise, this command displays the IP address 0.0.0.0.

Examples

# Display the source IP address for the current SFTP client.

<device> display sftp source-ip

The source IP you specified is 192.168.1.1

exit

Syntax

exit

View

SFTP client view

Parameters

None

Description

Use the exit command to terminate a connection with the remote SFTP server and return to system view.

This command has the same effect as that of the commands bye and quit.

Examples

# Terminate a connection with the remote SFTP server.

sftp-client> exit

Bye

[device]

get

Syntax

get remote-file [ local-file ]

View

SFTP client view

Parameters

remote-file: Name of a file on the remote SFTP server.

local-file: Name of a local file.

Description

Use the get command to download a file from the remote server.

By default, the remote file name is used for the file saved locally if no local file name is specified.

Examples

# Download the file tt.bak and save it with the name tt.txt.

sftp-client>get tt.bak tt.txt....

This operation may take a long time, please wait...

Remote  file:tt.bak --->  Local file: tt.txt..

Received status: End of file

Received status: Success

Downloading file successfully ended

help

Syntax

help [ all |command ]

View

SFTP client view

Parameters

all: Displays all the command names.

command: Command name.

Description

Use the help command to display the help information about SFTP client commands.

If no command is specified, this command displays all the command names.

Examples

# View the help information about the get command.

sftp-client> help get

get remote-path [local-path]  Download file.Default local-path is the same

                              with remote-path

ls

Syntax

ls [ -a | -l ] [ remote-path ]

View

SFTP client view

Parameters

-a: Displays the file and folder names in a specified directory.

-l: Displays the details about files and folders in a specified directory in a list.

remote-path: Name of the path where the files and folders to be queried reside.

Description

Use the Is command to display files in a specified directory on the remote SFTP server.

If -a or -l is not specified, the command displays details about the files and folders in the specified directory in a list.

If no remote path is specified, this command displays the files in the current working directory.

This command has the same effect as that of the dir command.

Examples

# Display the files in the current directory.

sftp-client> ls

-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 pubkey1

-rwxrwxrwx   1 noone    nogroup       225 Sep 28 08:28 pub1

drwxrwxrwx   1 noone    nogroup         0 Sep 28 08:24 new1

drwxrwxrwx   1 noone    nogroup         0 Sep 28 08:18 new2

-rwxrwxrwx   1 noone    nogroup       225 Sep 28 08:30 pub2

Received status: End of file

Received status: Success

mkdir

Syntax

mkdir remote-path

View

SFTP client view

Parameters

remote-path: Name of a directory on the remote SFTP server.

Description

Use the mkdir command to create a directory on the remote SFTP server.

Examples

# Create a directory named hj on the remote SFTP server.

sftp-client>mkdir hj

Received status: Success

New directory created

put

Syntax

put local-file [ remote-file ]

View

SFTP client view

Parameters

local-file: Name of a local file.

remote-file: Name of a file on the remote SFTP server.

Description

Use the put command to upload a local file to the remote SFTP server.

By default, the local file name is used for the remote file if no remote file name is specified.

Examples

# Upload the file named config.cfg to the remote SFTP server and save it as 1.txt.

sftp-client>put config.cfg 1.txt

This operation may take a long time, please wait...

Local file:config.cfg --->  Remote file: /1.txt

Received status: Success

Uploading file successfully ended

pwd

Syntax

pwd

View

SFTP client view

Parameters

None

Description

Use the pwd command to display the working directory on the remote SFTP server.

Examples

# Display the working directory on the remote SFTP server.

sftp-client> pwd

/

quit

Syntax

quit

View

SFTP client view

Parameters

None

Description

Use the quit command to terminate a connection with the remote SFTP server and return to system view.

This command has the same effect as that of the commands bye and exit.

Examples

# Terminate a connection with the remote SFTP server.

sftp-client> quit

Bye

[device]

remove

Syntax

remove remote-file&<1-10>

View

SFTP client view

Parameters

remote-file&<1-10>: Name of a file on the server. &<1-10> indicates that up to ten file names can be input. These file names should be separated by spaces.

Description

Use the remove command to delete a specified file from the remote SFTP server.

This command has the same effect as that of the delete command.

Examples

# Delete the file named temp.c from the server.

sftp-client> remove temp.c

The followed File will be deleted:

/temp.c

Are you sure to delete it?(Y/N):y

This operation may take a long time.Please wait...

 

Received status: Success

File successfully Removed

rename

Syntax

rename oldname newname

View

SFTP client view

Parameters

oldname: Old file name.

newname: New file name.

Description

Use the rename command to rename a specified file on the remote SFTP server.

Examples

# Change the file name temp.bat to temp.txt.

sftp-client> rename temp.bat temp.txt

File successfully renamed

rmdir

Syntax

rmdir remote-path&<1-10>

View

SFTP client view

Parameters

remote-path&<1-10>: Name of a directory on the remote SFTP server. &<1-10> indicates that up to ten file names can be input. These file names should be separated by spaces.

Description

Use the rmdir command to remove a specified directory from the remote SFTP server.

Examples

# Remove the hello directory on the SFTP server.

sftp-client>rmdir hello

The followed directory will be deleted

/hello

Are you sure to remove it?(Y/N):y

This operation may take a long time.Please wait...

 

Received status: Success

Directory successfully removed

sftp

Syntax

sftp { host-ip | host-name } [ port-num ] [identity-key { dsa | rsa } | prefer_kex { dh_group1 | dh_exchange_group } | prefer_ctos_cipher { des | aes128 } | prefer_stoc_cipher { des | aes128 } | prefer_ctos_hmac { sha1 | sha1_96 | md5 | md5_96 } | prefer_stoc_hmac { sha1 | sha1_96 | md5 | md5_96 } ] *

View

System view

Parameters

host-ip: IP address of the server.

host-name: Host name of the server, a string of 1 to 20 characters.

port-num: Port number of the server, in the range of 0 to 65,535. The default value is 22.

identity-key: The public key algorithm of the publickey authentication used.

l          Dsa: The public key algorithm is DSA.

l          Rsa: The public key algorithm is RSA.

prefer_kex: Specifies a preferred key exchange algorithm. You can select either of the two algorithms.

l          dh_group1: Key exchange algorithm diffie-hellman-group1-sha1. It is the default key exchange algorithm.

l          dh_exchange_group: Key exchange algorithm diffie-hellman-group-exchange-sha1.

prefer_ctos_cipher: Preferred client-to-server encryption algorithm. The default algorithm is aes128. 

prefer_stoc_cipher: Preferred server-to-client encryption algorithm. The default algorithm is aes128.

l          des: des_cbc encryption algorithm.

l          aes128: aes_128 encryption algorithm.

prefer_ctos_hmac: Preferred client-to-server HMAC algorithm. The default algorithm is sha1_96.

prefer_stoc_hmac: Preferred server-to-client HMAC algorithm. The default algorithm is sha1_96.

l          sha1: HMAC algorithm hmac-sha1.

l          sha1_96: HMAC algorithm hmac-sha1-96.

l          md5: HMAC algorithm hmac-md5.

l          md5_96: HMAC algorithm hmac-md5-96.

Description

Use the sftp command to establish a connection with the remote SFTP server and enter SFTP client view.

If you specify to authenticate a client through public key on the server, the client needs to read the local private key when logging in to the SFTP server. Since both RSA and DSA are available for public key authentication, you need to use the identity-key key word to specify the algorithms to get correct local private key; otherwise you will fail to log in.

Examples

# Connect the SFTP server with the IP address 10.1.1.2. Use the default encryption algorithm.

<device>system-view

System View: return to User View with Ctrl+Z.

[device]sftp 10.1.1.2

Input Username: kk

Trying 10.1.1.2...

Press CTRL+K to abort

Connected to 10.1.1.2 ...

 

The Server is not authenticated. Do you continue access it?(Y/N):y

Do you want to save the server's public key?(Y/N):y

Enter password:

 

sftp-client>

sftp source-interface

Syntax

sftp source-interface interface-type interface-number

undo sftp source-interface

View

System view

Parameters

interface-type: Type of a source interface. It can be loopback or VLAN interface.

interface-number: Number of a source interface.

Description

Use the sftp source-interface command to specify a source interface for the SFTP client. If the specified interface does not exist, the system prompts that the configuration fails.

Use the undo sftp source-interface command to remove the specified source interface. Then the client accesses the SFTP server with the local device address determined by the system.

Examples

# Specify Vlan interface 1 as the source interface of the SFTP client.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] sftp source-interface Vlan-interface 1

sftp source-ip

Syntax

sftp source-ip ip-address

undo sftp source-ip

View

System view

Parameters

ip-address: Source IP address to be set.

Description

Use the sftp source-ip command to specify a source IP address for the SFTP client. If the specified IP address is not the IP address of the local device, the system prompts that the configuration fails.

Use the undo sftp source-ip command to remove the specified source IP address. Then the client accesses the SFTP server with the local device address determined by the system.

Examples

# Specify 192.168.0.1 as the source IP address of the SFTP client.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] sftp source-ip 192.168.0.1

 


TFTP Configuration Commands

TFTP Configuration Commands

display tftp source-ip

Syntax

display tftp source-ip

View

Any view

Parameters

None

Description

Use the display tftp source-ip display the source IP address that the TFTP client uses every time it connects to a TFTP server. If a source interface is specified for the TFTP client, the IP address of the source interface is displayed. If neither source IP address nor source interface is specified for the TFTP client, 0.0.0.0 is displayed.

Examples

# Display the source IP address that the TFTP client uses every time it connects to a TFTP server.

<device> display tftp source-ip

The source IP you specified is 192.168.0.1

tftp

Syntax

tftp { ascii | binary }

View

System view

Parameters

ascii: Transfers data in ASCII mode.

binary: Transfers data in binary mode.

Description

Use the tftp { ascii | binary } command to set the TFTP data transfer mode.

By default, the binary mode is adopted.

Examples

# Specify to adopt the ASCII mode.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] tftp ascii

TFTP transfer mode changed to ASCII.

tftp get

Syntax

tftp tftp-server get source-file [ dest-file ]

View

User view

Parameters

tftp-server: IP address or the host name of a TFTP server.

source-file: Name of the file to be downloaded from the TFTP server.

dest-file: File name which the downloaded file is to be saved as.

Description

Use the tftp get command to download a file from a TFTP server to the local device.

Related commands: tftp put.

Examples

# Download the file named abc.txt from the TFTP server whose IP address is 1.1.1.1 and save it as efg.txt (suppose free space of the flash memory is sufficient).

<device> tftp 1.1.1.1 get abc.txt efg.txt

  File will be transferred in binary mode.

  Downloading file from remote tftp server, please wait......

  TFTP:       35 bytes received in 0 second(s).

  File downloaded successfully.

# Download the file temp.txt from the TFTP server (1.1.1.1) and save it as test1.txt (suppose that free space of the flash memory is insufficient and the TFTP server does not support file size negotiation).

<device> tftp 1.1.1.1 get temp.txt test1.txt

  File will be transferred in binary mode.

  Downloading file from remote tftp server, please wait......

  Not enough space; Writing to device failed; Downloaded data will be deleted.............

  Deleting file successful.

# Download the file temp.txt from the TFTP server (1.1.1.1) and save it as test2.txt (suppose that free space of the flash memory is insufficient and the TFTP server supports file size negotiation).

<device> tftp 1.1.1.1 get temp.txt test2.txt

  File will be transferred in binary mode.

  Downloading file from remote tftp server, please wait......

  Not enough space; Quit writing to device; Created file will be deleted.............

  Deleting file successful.

tftp put

Syntax

tftp tftp-server put source-file [ dest-file ]

View

User view

Parameters

tftp-server: IP address or the host name of a TFTP server.

source-file: Name of the file to be uploaded to the TFTP server.

dest-file: File name which the uploaded file is to be saved as.

Description

Use the tftp put command to upload a file to a specified directory on a TFTP server.

Related commands: tftp get.

Examples

# Upload the file named config.cfg to the TFTP server whose IP address is 1.1.1.1 and save it as temp.cfg.

<device> tftp 1.1.1.1 put config.cfg temp.cfg

  File will be transferred in binary mode.

  Copying file to remote tftp server. Please wait... /

  TFTP:      962 bytes sent in 0 second(s).

  File uploaded successfully.

tftp tftp-server source-interface

Syntax

tftp tftp-server source-interface interface-type interface-number { get source-file [ dest-file ] | put source-file-url [ dest-file ] }

View

User view

Parameters

tftp-server: IP address or host name of the TFTP server to be connected to.

interface-type: Type of the source interface.

interface-number: Number of the source interface.

get: Specifies to download a file from the TFTP server.

source-file: Name of the file to be downloaded.

dest-file: Name of the downloaded file to be saved locally.

put: Specifies to upload a file to the TFTP server.

source-file-url: Path and name of the file to be uploaded.

dest-file: Name of the uploaded file to be saved on the TFTP server.

Description

Use the tftp tftp-server source-interface command to connect to a TFTP server through the specified source interface, and perform download or upload operations. If the specified source interface does not exist, a prompt appears to show the command fails to be executed.

Examples

# Connect to the remote TFTP server whose IP address is 192.168.8.8 through the source interface VLAN-interface1, and download the file named config.cfg from it.

<device> tftp 192.168.8.8 source-interface Vlan-interface 1 get config.cfg

tftp tftp-server source-ip

Syntax

tftp tftp-server source-ip ip-address { get source-file [ dest-file ] | put source-file-url [ dest-file ] }

View

User view

Parameters

tftp-server: IP address or host name of the TFTP server to be connected to.

ip-address: IP address to be set as the source IP address.

get: Specifies to download a file from the TFTP server.

source-file: Name of the file to be downloaded.

dest-file: Name of the downloaded file to be saved locally.

put: Specifies to upload a file to the TFTP server.

source-file-url: Path and name of the file to be uploaded.

dest-file: Name of the uploaded file to be saved on the TFTP server.

Description

Use the tftp tftp-server source-ip command to connect to a TFTP server through the specified source IP address, and perform download or upload operations. If the specified source IP address does not exist, a prompt appears to show the command fails to be executed.

Examples

# Connect to the remote TFTP server whose IP address is 192.168.8.8 through the source IP address 192.168.0.1, and download the file named config.cfg from it.

<device> tftp 192.168.8.8 source-ip 192.168.0.1 get config.cfg

tftp source-interface

Syntax

tftp source-interface interface-type interface-number

undo tftp source-interface

View

System view

Parameters

interface-type: Type of the source interface.

interface-number: Number of the source interface.

Description

Use the tftp source-interface command to specify the source interface of a TFTP client that the TFTP client uses every time it connects to a TFTP server. The system prompts that the configuration fails if the specified interface does not exist.

Use the undo tftp source-interface command to cancel the source interface setting. After you execute this command, the TFTP client system decides which interface will be used for accessing TFTP servers.

Examples

# Specify Vlan interface1 as the source interface that the TFTP client uses every time it connects to a TFTP server.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] tftp source-interface Vlan-interface 1

tftp source-ip

Syntax

tftp source-ip ip-address

undo tftp source-ip

View

System view

Parameters

ip-address: IP address that is to be specified as the source IP address.

Description

Use the tftp source-ip command to specify the source IP address of a TFTP client that the TFTP client uses every time it connects with a TFTP server. The value of argument ip-address must be an IP address on the device where the configuration is performed. Otherwise, a prompt appears to show the configuration fails.

Use the undo tftp source-ip command to cancel the source IP address setting. After you execute this command, the TFTP client system decides which IP address on it will be used for accessing TFTP servers.

Examples

# Specify 192.168.0.1 as the source IP address that the TFTP client uses every time it connects to a TFTP server.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] tftp source-ip 192.168.0.1

tftp-server acl

Syntax

tftp-server acl acl-number

undo tftp-server acl

View

System view

Parameters

acl-number: Basic ACL number, in the range 2000 to 2999.

Description

Use the tftp-server acl command to specify the ACL adopted for the connection between a TFTP client and a TFTP server.

Use the undo tftp-server acl command to cancel all ACLs adopted.

Examples

# Specify to adopt ACL 2000 on the TFTP client.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] tftp-server acl 2000

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网