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 operates 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 operating 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 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.
|
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 authorized directory.
Example
# Display FTP user settings.
<H3C> display ftp-user
Username Host IP Port Idle Homedir
H3C 10.110.3.5 1074 2 flash:
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 minute
undo ftp timeout
View
System view
Parameter
minute: Connection
idle time (in minutes) ranging from 1 to 35,791. The default connection idle
time is 30 minutes.
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.
If a 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 terminate it if no
data exchange occurs on it in a specific period known as 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 ASCII mode. That is, data is transferred in ASCII
characters.
By default, files are transferred in 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]
# Specify to transfer files in 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 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]
# Specify to transfer files in binary mode.
[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 quit to
user view.
This command has the same effect as that of
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 quit to user view.
[ftp] bye
<H3C>
Syntax
cd pathname
View
FTP client view
Parameter
pathname:
Path name
Description
Use the cd command to change the
work path on the remote FTP server.
Note that you can only use this command to
enter authorized directories.
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
# 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 exit the
current work directory and enter the parent 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
# Enter the parent directory.
[ftp] cdup
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 that of
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:
File name
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. The output information includes the name, size and creation
time of a file 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.
[ftp] dir
200 PORT command okay
7 File Listing Follows in ASCII mode
-rwxrwxrwx 1 noone nogroup
430585 Dec 21 2004 4.app
-rwxrwxrwx 1 noone nogroup
430585 Dec 21 2004 5.app
-rwxrwxrwx 1 noone nogroup
430585 Dec 23 2004 6. app
-rwxrwxrwx 1 noone nogroup
430585 Dec 21 2004 6. app.bak
-rwxrwxrwx 1 noone nogroup
638912 Nov 15 2004 abc.BTM
drwxrwxrwx 1 noone nogroup
0 Dec 15 2004 TEST
-rwxrwxrwx 1 noone nogroup
3212176 Jul 14 2004 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
a FTP connection without quitting FTP client view.
This command has the same effect as that of
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 [remote-server
[ port-number ] ]
View
User view
Parameter
remote-server: 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, ranging from 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.
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.
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: 749881 byte(s) received in
17.186 second(s) 43.00K 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
information about a specified remote file.
If you do not specify the remotefile
argument, names of all the files and directories in the current remote directory
are displayed.
Caution:
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.
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.
[ftp] ls
200 PORT command okay
7 File Listing Follows in ASCII mode
4.app
5.app
6.app
6.app.bak
abc.BTM
TEST
21.bin
226 Transfer finished successfully.
FTP: 1235 byte(s) received in 1.595
second(s) 774.00byte(s)/sec.
Syntax
mkdir pathname
View
FTP client view
Parameter
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.
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 remote-server
[ port-number ]
View
FTP client view
Parameter
remote-server: 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 on the remote FTP server, ranging from 0 to 65535. 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
Syntax
put localfile
[ remotefile ]
View
FTP client view
Parameter
localfile:
Name of a local file.
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 temp.c.
226 Transfer complete.
FTP: 749881 byte(s) sent in 17.691
second(s) 42.00Kbyte(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
FTP control connection and FTP data connection and quit to user view.
This command has the same effect as that of
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 control connection and FTP
data connection and quit to user view.
[ftp] quit
<H3C>
Syntax
remotehelp [
protocol-command ]
View
FTP client view
Parameter
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.
Caution:
l
This command is always valid when a H3C series
switch operates as the FTP server.
l
If you use other FTP server software, refer to
related instructions to know whether it provides 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
rename remote-source
remote-dest
View
FTP client view
Parameter
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 host.
If the destination file name conflicts with
the name of an existing file or directory, you will fail to rename the 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]
# Rename the file named temp.c as forever.c.
[ftp] rename temp.c forever.c
350 Enter the name to rename it to...
250 File renamed successfully
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: User
name used to log into an FTP server.
password: Password
used to log into an FTP server.
Description
Use the user command to log into an
FTP server with the specified user name and password.
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]
# 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 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 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.
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
Syntax
tftp { ascii
| binary }
View
System view
Parameter
ascii:
Transfers data in the ASCII mode.
binary:
Transfers data in the binary mode.
Description
Use the tftp { ascii | binary
} command to set the TFTP data transfer mode.
By default, the binary mode is adopted.
Example
# Specify to adopt the ASCII mode.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] tftp ascii
TFTP transfer mode changed to ASCII.
Syntax
tftp tftp-server get source-file [ dest-file ]
View
User view
Parameter
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 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 (suppose free space
of the flash memory is sufficient).
<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.
# 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).
<H3C> 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).
<H3C> 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.
Syntax
tftp tftp-server put source-file [ dest-file ]
View
User view
Parameter
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 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.
Syntax
tftp-server acl acl-number
undo tftp-server acl
View
System view
Parameter
acl-number:
Basic ACL number ranging from 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.
Example
# Specify to adopt ACL 2000 on the TFTP
client.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] tftp-server acl 2000