Syntax
display ftp-server
View
Any view
Parameter
None
Description
Use the display ftp-server command
to display the FTP server-related settings of a switch when it functions as an
FTP server.
You can use this command to verify FTP
server-related configurations.
Example
# Display the FTP server-related settings
of the switch (assuming that the switch is functioning as an FTP server).
<H3C> display ftp-server
FTP server is running
Max user number 1
User count 0
Timeout value(in minute) 30
Table 1-1 Description on the fields of
the display ftp-server command
|
Field
|
Description
|
|
FTP server is running
|
The FTP server is started.
|
|
Max user number
|
Maximum number of simultaneous login
users supported
|
|
User count
|
Current
login user quantity
|
|
Timeout
value (in minute)
|
Connection
idle time
|
Syntax
display ftp-user
View
Any view
Parameter
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 work directory.
Example
# Display FTP user settings.
<H3C> display ftp-user
Username Host IP Port Idle Homedir
H3C 10.110.3.5 1074 2 flash:/H3C
# If the user name exceeds ten characters in
length, characters behind the tenth will be displayed in a new line in the
flush-left mode. Take username username@test for example, the result is:
<H3C> display ftp-user
Username Host IP Port Idle Homedir
username@t 10.110.3.5 1074 2 flash:/H3C
est
Syntax
ftp sever enable
undo ftp sever
View
System view
Parameter
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.
Example
# Enable the FTP server.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] ftp server enable
% Start FTP server
Syntax
ftp timeout minutes
undo ftp timeout
View
System view
Parameter
minutes: Connection
idle time (in minutes) ranging from 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.
The default connection idle time is 30
minutes.
If an FTP connection between an FTP server
and an FTP client breaks down abnormally and the FTP server is not informed of
this timely, the FTP server keeps the connection as usual.
You can set a connection idle time, so that
the FTP server considers an FTP connection to be invalid and terminates it if
no data exchange occurs on it within the connection idle time.
Example
# Set the connection idle time to 36
minutes.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] ftp timeout 36
Syntax
ascii
View
FTP client view
Parameter
None
Description
Use the ascii command to specify
that files be transferred in the ASCII mode.
By default, files are transferred in the ASCII
mode.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Set the mode of data transfer to the
ASCII mode.
[ftp] ascii
200 Type set to A.
Syntax
binary
View
FTP client view
Parameter
None
Description
Use the binary command to specify
that files be transferred in the binary mode.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Set the binary mode for file transfer.
[ftp] binary
200 Type set to I.
Syntax
bye
View
FTP client view
Parameter
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 the quit
command.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Terminate the connections with the remote
FTP server and return to user view.
[ftp]bye
221 Server closing.
<H3C>
Syntax
cd pathname
View
FTP client view
Parameter
pathname:
Path name
Description
Use the cd command to change the
work directory on the remote FTP server.
Note that you can use this command to enter
the authorized directories only.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Change the work directory to flash:/temp.
[ftp] cd flash:/temp
250 CWD command successful.
# Display the current work directory.
[ftp] pwd
257 "flash:/temp" is
current directory.
Syntax
cdup
View
FTP client view
Parameter
None
Description
Use the cdup command to go to the
upper-level directory of the current directory.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Change the work directory to flash:/temp.
[ftp] cd flash:/temp
250 CWD command successful.
# Change the work directory to the
upper-level directory.
[ftp] cdup
200 CDUP command successful.
# Display the current directory.
[ftp] pwd
257 "flash:" is current
directory.
Syntax
close
View
FTP client view
Parameter
None
Description
Use the close command to terminate
an FTP connection without quitting FTP client view.
This command has the same effect as the disconnect
command.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Terminate the FTP connection without
quitting FTP client view.
[ftp] close
221 Server closing.
[ftp]
Syntax
debugging
undo debugging
View
FTP client view
Parameter
None
Description
Use the debugging command to enable
system debugging.
Use the undo debugging command to
disable system debugging.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Enable system debugging.
[ftp] debugging
% Debug is on
Syntax
delete remotefile
View
FTP client view
Parameter
remotefile:
Name of the file to be deleted.
Description
Use the delete command to delete a
specified remote file.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password,
please
Password:
230 Logged in successfully
[ftp]
# Delete the file named temp.c.
[ftp] delete temp.c
250 DELE command successful.
Syntax
dir [
filename [ localfile ] ]
View
FTP client view
Parameter
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.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Display the information about all the
files in the current directory on the remote FTP server.
[ftp] dir
200 PORT command okay
150 File Listing Follows in ASCII
mode
-rwxrwxrwx 1 noone nogroup
430585 Dec 21 2005 4.app
-rwxrwxrwx 1 noone nogroup
430585 Dec 21 2005 5.app
-rwxrwxrwx 1 noone nogroup
430585 Dec 23 2005 6. app
-rwxrwxrwx 1 noone nogroup
430585 Dec 21 2005 6. app.bak
-rwxrwxrwx 1 noone nogroup
638912 Nov 15 2005 abc.BTM
drwxrwxrwx 1 noone
nogroup 0 Dec 15 2005 TEST
-rwxrwxrwx 1 noone nogroup
3212176 Jul 14 2005 21.bin
226 Transfer finished successfully.
FTP: 5346 byte(s) received in 6.782
second(s) 788.00 byte(s)/sec.
# Display the information about the file
named 4.app and save the output information in the file named temp1.
[ftp] dir 4.app temp1
200 PORT command okay
150 File Listing Follows in ASCII
mode
-rwxrwxrwx 1 noone nogroup
430585 Dec 21 2004 4. app
226 Transfer finished successfully.
FTP: 70 byte(s) received in 0.122
second(s) 573.00 byte(s)/sec.
Syntax
disconnect
View
FTP client view
Parameter
None
Description
Use the disconnect command to
terminate an FTP connection without quitting FTP client view.
This command has the same effect as the close
command.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Terminate the FTP connection without
quitting FTP client view.
[ftp]
disconnect
221 Server closing.
[ftp]
Syntax
ftp [ cluster
| ftp-server [ port-number ] ]
View
User view
Parameter
cluster:
Specifies to connect to a cluster FTP server.
ftp-server:
Host name or 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, ranging from 0 to 65,535. The default is 21.
Description
Use the ftp command to establish a
control connection with an FTP server and enter FTP client view.
Example
# Connect to the FTP server whose IP
address is 2.2.2.2.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
Syntax
get remotefile
[ localfile ]
View
FTP client view
Parameter
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 using
its original name.
Caution:
l
When using the get command to download
files from a remote FTP server, make sure the number of the characters
contained in the path and file name is within the system-acceptable range.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Download the file named temp.c.
[ftp] get temp.c
200 Port command okay.
150 Opening ASCII mode data
connection for temp.c.
...226 Transfer complete.
FTP: 2162 byte(s) received in 4.163
second(s) 519.33 byte(s)/sec.
Syntax
lcd
View
FTP client view
Parameter
None
Description
Use the lcd command to display the
local work directory on the FTP client.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Display the local work directory.
[ftp] lcd
% Local directory now flash:/temp
Syntax
ls [ remotefile
[ localfile ] ]
View
FTP client view
Parameter
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
name of a specified file on a remote FTP server.
If you do not specify the remotefile
argument, the names of all the files in the current remote directory are
displayed.
Caution:
The ls command can only be used to display file names, while
the dir command can be used to display file information in detail,
including file size, and creation date.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Display the names of all the files in the
current directory on the remote FTP server.
200 Port command okay.
150 Opening ASCII mode data
connection for *.
s7500.app
test.cfg
s7500-1.app
another.bat
test
default.diag
226 Transfer complete.
FTP: 189 byte(s) received in 0.011
second(s) 17.18Kbyte(s)/sec.
1.2.15 mkdir
Syntax
mkdir pathname
View
FTP client view
Parameter
Pathname:
Name of the directory to be created.
Description
Use the mkdir command to create a
directory on an FTP server.
This command is available only to the FTP
clients that are authorized to create directories on FTP servers.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Create the directory flash:/lanswitch on
the FTP server.
[ftp] mkdir
flash:/lanswitch
257 "flash:/ lanswitch" new
directory created.
Syntax
open { ip-address
| server-name } [ port ]
View
FTP client view
Parameter
ip-address:
IP address of an FTP server.
server-name:
Host name of the FTP server, a string comprising 1 to 20 characters.
port: Port
number on the remote FTP server, ranging from 0 to 65,535. The default value is
21.
Description
Use the open command to establish a
control connection with an FTP server.
Related command: close.
Example
# Enter FTP client view.
<H3C> 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-
220 WFTPD 2.0 service (by Texas Imperial
Software) ready for new user
User(none):abc
331 Give me your password, please
Password:
230 Logged in successfully
Syntax
passive
undo passive
View
FTP client view
Parameter
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.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Set the data transfer mode to the passive
mode.
[ftp] passive
% Passive is on
Syntax
put localfile
[ remotefile ]
View
FTP client view
Parameter
localfile:
Name of a local file to be uploaded.
remotefile:
File name which the local file is to be saved as.
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 using the original name.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Upload the local file named temp.c to the
FTP server.
[ftp] put temp.c
200 Port command okay.
150 Opening ASCII mode data
connection for config.cfg.
Operation may take a long time,
please wait...
226 Transfer complete.
FTP: 2162 byte(s) sent in 12.115
second(s) 178.45byte(s)/sec.
Syntax
pwd
View
FTP client view
Parameter
None
Description
Use the pwd command to display the
work directory on an FTP server.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Display the work directory on the FTP
server.
[ftp] pwd
257 "flash:/temp" is
current directory.
Syntax
quit
View
FTP client view
Parameter
None
Description
Use the quit command to terminate an
FTP connection and return to user view.
This command has the same effect as the bye
command.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Terminate the FTP connection and return
to user view.
[ftp] quit
221 Windows FTP Server (WFTPD, by
Texas Imperial Software) says goodbye
<H3C>
Syntax
remotehelp [
protocol-command ]
View
FTP client view
Parameter
protocol-command:
FTP protocol command.
Description
Use the remotehelp command to
display the on-line help of an FTP protocol command.
This command works only when the FTP server
provides the on-line help information about FTP protocol commands.
Caution:
l
This command is always valid when a H3C switch
functions as an FTP server.
l
If you use other FTP server software, refer to
related instructions to see whether it provides on-line help information about
FTP protocol commands.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Display the syntax of the user
command.
[ftp] remotehelp user
214 Syntax: USER <sp>
<username>
Syntax
rmdir pathname
View
FTP client view
Parameter
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.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Remove the directory flash:/temp1 on the
FTP server (Assume that the directory is empty).
[ftp] rmdir flash:/temp1
200 RMD command successful.
Syntax
user username
[ password ]
View
FTP client view
Parameter
username:
Name of the login user.
password:
Password corresponding to the user.
Description
Use the user command to switch to a
specified user.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Switch to the user named tom, assuming
that the corresponding password is 111.
[ftp] user tom 111
331 Give me your password, please
230 Logged in successfully
Syntax
verbose
undo verbose
View
FTP client view
Parameter
None
Description
Use the verbose command to enable
the verbose function, which displays the execution and response information of
a command.
Use the undo verbose command to
disable the verbose function.
The verbose function is enabled by default.
Example
# Enter FTP client view.
<H3C> ftp 2.2.2.2
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas
Imperial Software) ready for new user
User(none):switch
331 Give me your password, please
Password:
230 Logged in successfully
[ftp]
# Enable the verbose function.
[ftp] verbose
% Verbose is on
1.3.1 tftp get
Syntax
tftp { cluster
| tftp-server } get source-file
[ dest-file ]
View
User view
Parameter
cluster:
Specifies to connect to a cluster FTP server.
tftp-server:
IP address or 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 switch.
Related command: tftp put.
Example
# Download the file named abc.txt from the
TFTP server whose IP address is 1.1.1.1 and save it as efg.txt.
<H3C> 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.
Syntax
tftp { cluster
| tftp-server } put source-file
[ dest-file ]
View
User view
Parameter
cluster:
Specifies to connect to a cluster FTP server.
tftp-server:
IP address or 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 from an Ethernet switch to a specified directory on a TFTP server.
Related command: tftp get.
Example
# Upload the file named config.cfg to the
TFTP server whose IP address is 1.1.1.1 and save it as temp.cfg.
<H3C> 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.
1.3.3 tftp-server acl
Syntax
tftp-server acl acl-number
undo tftp-server acl
View
System view
Parameter
acl-number:
Basic ACL number ranging from 2,000 to 2,999.
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 the ACLs adopted.
Example
# Adopt ACL 2000 on the TFTP client.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] tftp-server acl 2000