- Table of Contents
-
- H3C S9500 Command Manual-Release1648[v1.24]-08 System Volume
- 00-1Cover
- 01-Command Line Interface Commands
- 02-Login and User Interface Commands
- 03-FTP and TFTP Commands
- 04-HA Commands
- 05-NQA Commands
- 06-NetStream Commands
- 07-NTP Commands
- 08-RMON Commands
- 09-SNMP Commands
- 10-Packet Statistics Accounting Commands
- 11-Device Management Commands
- 12-Configuration File Management Commands
- 13-File System Management Commands
- 14-Cluster Management Commands
- 15-System Maintenance and Debugging Commands
- 16-Information Center Commands
- 17-PoE Commands
- 18-Clock Module Commands
- 19-ACSEI Server Commands
- 20-OAP Module Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
03-FTP and TFTP Commands | 105.48 KB |
Table of Contents
Chapter 1 FTP and TFTP Configuration Commands
1.1 FTP Server Configuration Commands
1.3 TFTP Configuration Commands
Chapter 1 FTP and TFTP Configuration Commands
1.1 FTP Server Configuration Commands
1.1.1 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 current FTP server.
You can use this command to verify FTP server-related configurations.
Examples
# Display the FTP server-related settings of the FTP server.
<H3C> display ftp-server
FTP server is running
Max user number 2
User count 0
Timeout value(in minute) 30
1.1.2 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(s).
Examples
# Display FTP user settings.
<H3C> display ftp-user
% No ftp user
1.1.3 ftp disconnect
Syntax
ftp disconnect user-name
View
System view
Parameters
user-name: Name of the user to be disconnected from the FTP server.
Description
Use the ftp disconnect command to terminate the connection between a specified user and the FTP server.
Examples
# Disconnect the user named ftptest from the FTP server.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] ftp disconnect ftptest
1.1.4 ftp server enable
Syntax
ftp server enable
undo ftp server
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.
Use the commands to enable or disable the FTP server at proper time to avoid potential security risks.
Examples
# Disable the FTP server.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] undo ftp server
% Close FTP server
1.1.5 ftp timeout
Syntax
ftp timeout minute
undo ftp timeout
View
System view
Parameters
minutes: 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.
Examples
# Set the connection idle time to 36 minutes.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] ftp timeout 36
1.1.6 local-user
Syntax
local-user { username | password-display-mode { auto | cipher-force } }
undo local-user { username | all [ service-type { ftp | lan-access | telnet | ppp | ssh | terminal } ] | password-display-mode }
View
System view
Parameters
username: User name.
password-display-mode: Mode of password display.
auto: Specifies to display the password in the specified mode.
cipher-force: Specifies to display the password in cipher text mode by force.
all: All local users.
service-type: Type of the specified user.
ftp indicates all local FTP users.
lan-access indicates all local users accessing the LAN.
telnet indicates all local Telnet users.
ppp indicates all point-to-point access local views.
SSH indicates all local SSH views.
terminal indicates all user terminals.
Description
Use the local-user command to create a local user and enter local user view.
Use the undo local-user command to delete one or all local users.
By default, there is no user in the system user database.
If a client user wants to access the FTP server through FTP, you must use the command to do corresponding settings.
Examples
# Create a local user and enter local user view.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] local-user H3C
[H3C-luser-H3C]
1.1.7 password
Syntax
password [ simple | cipher ] password
undo password
View
Local user view
Parameters
simple: Specifies to display the password in plain text.
cipher: Specifies to display the password in cipher text.
password: Password you set. For simple mode, the password must be set in plain text; for cipher mode, the password can be set either in cipher text or in plain text. A plain text password can be a string up to 63 characters, such as aabbcc. A cipher text password is a string of 88 characters.
password: Login password of a user.
Description
Use the password command to set the login password for a local user.
Use the undo password command to delete the password of a user.
By default, no password is configured for local users.
If a client user wants to access the FTP server through FTP, you must configure a password for the user.
Examples
# Configure the password to be 123456 for the local user H3C.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C]local-user H3C
New local user added.
[H3C-luser-H3C] password cipher 123456
Updating the password file, please wait...
1.1.8 service-type
Syntax
service-type { ftp [ ftp-directory directory ] | lan-access | ppp [ call-number call-number | callback-nocheck | callback-number callback-number ] | ssh [ level level | telnet | terminal ] | telnet [ level level | ssh | terminal ] | terminal [ level level | ssh | telnet ] }
undo service-type { ftp [ ftp-directory directory ] | lan-access | ppp [ call-number call-number | callback-nocheck | callback-number callback-number ] | ssh [ level level | telnet | terminal ] | telnet [ level level | ssh | terminal ] | terminal [ level level | ssh | telnet ] }
View
Local user view
Parameters
ftp: Specifies a user as an FTP user.
ftp-directory directory: Specifies the directory of a specified FTP user. The directory argument is a string up to 64 characters long.
lan-access: Specifies the user type as Lan-access (mainly refers to the Ethernet user, such as the 802.1x user).
ppp: Specifies the user type as PPP.
call-number: Specifies the calling number.
callback-nocheck: Specifies the Modem not to check callback.
callback-number: Specifies the dialing string for a callback user.
ssh: Specifies the user type as SSH.
telnet: Specifies the user type as Telnet.
level level: Specifies the level of a Telnet user. The level argument is an integer, in the range 0 to 3, and defaults to 0.
terminal: Specifies the user type as terminal.
Description
Use the service-type command to specify the type of a local user and the corresponding parameters of that type.
Use the undo service-type command to cancel the configuration.
If a client user wants to access the FTP server through FTP, you must use the command to specify the user type as FTP.
Examples
# Specify user H3C as an FTP user.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C]local-user H3C
New local user added.
[H3C-luser-H3C] service-type ftp ftp-directory flash:/
1.2 FTP Client Commands
1.2.1 ascii
Syntax
ascii
View
FTP Client view
Parameters
None
Description
Use the ascii command to configure data transmission mode as ASCII mode.
By default, the file transmission mode is ASCII mode.
Perform this command if the user needs to change the file transmission mode to default mode.
Examples
# Configure to transmit data in the ASCII mode.
<H3C> ftp 192.168.0.86
Trying ...
Press CTRL+K to abort
Connected.
220 WFTPD 2.0 service (by Texas Imperial Software) ready for new user
User(none):8500
331 Give me your password, please
Password:
230 Logged in successfully
[ftp] ascii
200 Type is ASCII
1.2.2 binary
Syntax
binary
View
FTP Client view
Parameters
None
Description
Use the binary command to configure file transmission type as binary mode.
Examples
# Configure to transmit data in the binary mode.
<H3C> ftp 192.168.0.86
[ftp] binary
200 Type is Image (Binary)
1.2.3 bye
Syntax
bye
View
FTP Client view
Parameters
None
Description
Use the bye command to disconnect with the remote FTP Server and return to user view.
After performing this command, you can terminate the control connection and data connection with the remote FTP Server.
Examples
# Terminate connection with the remote FTP Server and return to user view.
<H3C> ftp 192.168.0.86
[ftp] bye
1.2.4 cd
Syntax
cd pathname
View
FTP Client view
Parameters
pathname: Path name.
Description
Use the cd command to change the working path on the remote FTP Server.
This command is used to access another directory on FTP Server. Note that the user can only access the directories authorized by the FTP server.
Examples
# Change the working path to flash:/temp
<H3C> ftp 192.168.0.86
[ftp] cd flash:/temp
1.2.5 cdup
Syntax
cdup
View
FTP Client view
Parameters
None
Description
Use the cdup command to change working path to the upper level directory.
This command is used to exit the current directory and return to the upper level directory.
Examples
# Change working path to the upper level directory.
<H3C> ftp 192.168.0.86
[ftp] cdup
1.2.6 close
Syntax
close
View
FTP Client view
Parameters
None
Description
Use the close command to disconnect FTP client side from FTP server side without exiting FTP client side view. That is to say, you can terminate the control connection and data connection with the remote FTP Server at the same time.
Examples
# Terminate connection with the remote FTP Server and stays in FTP Client view.
<H3C> ftp 192.168.0.86
[ftp] close
1.2.7 debugging
Syntax
debugging
undo debugging
View
FTP Client view
Parameters
None
Description
Use the debugging command to enable the debugging for FTP Client commands.
Use the undo debugging command to disable the debugging for FTP Client commands.
By default, the debugging for FTP Client commands is disabled.
Examples
# Enable the debugging for FTP Client commands.
<H3C> ftp 192.168.0.86
[ftp] debugging
1.2.8 delete
Syntax
delete remotefile
View
FTP Client view
Parameters
remotefile: File name.
Description
Use the delete command to cancel the specified file.
Examples
# Delete the file temp.c.
<H3C> ftp 192.168.0.86
[ftp] delete temp.c
1.2.9 dir
Syntax
dir [ filename ] [ localfile ]
View
FTP Client view
Parameters
filename: File name to be queried.
localfile: Saves local file name of the query result.
Description
Use the dir command to query a specified file.
If no parameter of this command is specified, then all the files in the directory will be displayed.
Examples
# Query the file temp.c and saves the results in the file temp1.
<H3C> ftp 192.168.0.86
[ftp] dir temp.c temp1
1.2.10 disconnect
Syntax
disconnect
View
FTP Client view
Parameters
None
Description
Use the disconnect command to disconnect FTP Client side from FTP server side without exiting FTP client side view.
This command terminates the control connection and data connection with the remote FTP Server at the same time.
Examples
# Terminate connection with the remote FTP Server and stays in FTP Client view.
<H3C> ftp 192.168.0.86
[ftp] disconnect
1.2.11 ftp
Syntax
ftp [{ ipaddress | host-name} [ port ] ]
View
User view
Parameters
ipaddress: IP address of the remote FTP Server.
port: Port number of remote FTP Server.
Host-name: Name of the remote FTP Server, a string which is 1 to 30 characters long.
Description
Use the ftp command to establish control connection with the remote FTP Server and enter FTP Client view.
Examples
# Connect to FTP Server at the IP address 1.1.1.1
<H3C> ftp 1.1.1.1
1.2.12 get
Syntax
get remotefile [ localfile ]
View
FTP Client view
Parameters
localfile: Local file name.
remotefile: Name of a file on the remote FTP Server.
Description
Use the get command to download a remote file and save it locally.
If no local file name is specified, it will be considered the same as that on the remote FTP Server.
Examples
# Download the file temp1.c and saves it as temp.c
<H3C> ftp 192.168.0.86
[ftp] get temp1.c temp.c
1.2.13 lcd
Syntax
lcd
View
FTP Client view
Parameters
None
Description
Use the lcd command to view local working path of FTP Client.
Examples
# Show local working path.
<H3C> ftp 192.168.0.86
[ftp] lcd
% Local directory now flash:/temp
1.2.14 ls
Syntax
ls [ remotefile [ localfile ] ]
View
FTP Client view
Parameters
remotefile: Remote file to be queried.
localfile: Saves local file name of the query result.
Description
Use the ls command to query a specified file.
If no parameter is specified, all the files will be shown.
Note that, the ls command only displays the file names, while the dir command also displays other file-related information such as the file size and creation date.
Examples
# Query file temp.c
<H3C> ftp 192.168.0.86
[ftp] ls temp.c
1.2.15 mkdir
Syntax
mkdir pathname
View
FTP Client view
Parameters
pathname: Directory name.
Description
Use the mkdir command to create a directory on the remote FTP Server.
User can perform this operation as long as the remote FTP server has authorized.
Examples
# Create the directory flash:/lanswitch on the remote FTP Server.
<H3C> ftp 192.168.0.86
[ftp] mkdir flash:/lanswitch
1.2.16 open
Syntax
open ipaddr [ port ]
View
FTP Client view
Parameters
ipaddr: IP address of the remote FTP server.
port: Port number of the remote server.
Description
Use the open command to set up an FTP connection with a remote FTP server.
Examples
# Set up a FTP connection with the FTP server with the IP address of 10.110.3.1.
<H3C> ftp 192.168.0.86
[ftp] open 10.110.3.1
1.2.17 passive
Syntax
passive
undo passive
View
FTP Client view
Parameters
None
Description
Use the passive command to configure the data transmission mode as passive mode.
Use the undo passive command to configure the data transmission mode as active mode.
By default, the data transmission mode is passive mode
Examples
# Set the data transmission to passive mode.
<H3C> ftp 192.168.0.86
[ftp] passive
1.2.18 put
Syntax
put localfile [ remotefile ]
View
FTP Client view
Parameters
localfile: Local file name.
remotefile: File name on the remote FTP Server.
Description
Use the put command to upload a local file to the remote FTP Server.
If the user does not specify the filename on the remote server, the system will consider it the same as the local file name by default.
Examples
# Upload the local file temp.c to the remote FTP Server and saves it as temp1.c.
<H3C> ftp 192.168.0.86
[ftp] put temp.c temp1.c
1.2.19 pwd
Syntax
pwd
View
FTP Client view
Parameters
None
Description
Use the pwd command to view the current directory on the remote FTP Server.
Examples
# Show the current directory on the remote FTP Server.
<H3C> ftp 192.168.0.86
[ftp] pwd
"flash:/temp" is current directory.
1.2.20 quit
Syntax
quit
View
FTP Client view
Parameters
None
Description
Use the quit command to terminate the connection with the remote FTP Server and return to user view.
Examples
# Terminate connection with the remote FTP Server and returns to user view.
<H3C> ftp 192.168.0.86
[ftp] quit
<H3C>
1.2.21 remotehelp
Syntax
remotehelp [ protocol-command ]
View
FTP Client view
Parameters
protocol-command: FTP protocol command.
Description
Use the remotehelp command to view help information about the FTP protocol command. This command takes effects only when the FTP server provides the protocol command help. (S9500 series serving as servers provide this help service, but common FTP software do not provide this service).
Caution:
The protocol-command argument here is not required to be input by a protocol command, but the command word(s) to be exchanged by FTP protocols(the command words of the command you want to query).
Examples
# Show the syntax of the protocol command user.
<H3C> ftp 192.168.0.86
[ftp] remotehelp user
214 Syntax: USER <sp> <username>
1.2.22 rmdir
Syntax
rmdir pathname
View
FTP Client view
Parameters
pathname: Directory name of remote FTP Server.
Description
Use the rmdir command to remove the specified directory from FTP Server. Note that, this command can be successfully executed only when the specified directory contains no files.
Examples
# Delete the directory flash:/temp1 from FTP Server.
<H3C> ftp 192.168.0.86
[ftp] rmdir flash:/temp1
1.2.23 user
Syntax
user username [ password ]
View
FTP Client view
Parameters
username: Logon username.
password: Logon password.
Description
Use the user command to register an FTP user.
This command is available when you log in FTP server with a specified user account.
Examples
# Log in the FTP Server with username tom and password bjhw.
<H3C> ftp 192.168.0.86
[ftp] user tom bjhw
1.2.24 verbose
Syntax
verbose
undo verbose
View
FTP Client view
Parameters
None
Description
Use the verbose command to enable the client to display the commands received from/sent to the server.
Use the undo verbose command to disable the client from display the commands received from/sent to the server
By default, the VERBOSE is enabled and the client displays the commands received from/sent to the server.
Examples
# Enable VERBOSE.
<H3C> ftp 192.168.0.86
[ftp]verbose
1.3 TFTP Configuration Commands
1.3.1 tftp get
Syntax
tftp tftp-server get source-file [ dest-file ]
View
User view
Parameters
tftp-server: IP address or hostname of the TFTP server. The name of the TFTP server should be a string ranging from 1 to 20 characters.
source-file: Filename of the source file on the TFTP server.
dest-file: Filename of the destination file which will be saved on the switch.
Description
Use the tftp get command to download a file from the specified directory of the TFTP server and saving it on the switch.
Related commands: tftp put.
Examples
# Download the file LANSwitch.app from the TFTP server at 1.1.3.214 and save it as vxWorks.app on the local switch.
<H3C> tftp 1.1.3.214 get LANSwitch.app vxWorks.app
1.3.2 tftp put
Syntax
tftp tftp-server put source-file [ dest-file ]
View
User view
Parameters
tftp-server: IP address or hostname of the TFTP server. The name of the TFTP server should be a string ranging from 1 to 20 characters.
source-file: Filename of the source file which is saved on the switch.
dest-file: Name of the saved-as file uploaded to the specified directory on the TFTP server.
Description
Use the tftp put command to upload a file from the switch to the specified directory on the TFTP server.
Related commands: tftp get.
Examples
# Upload the config.txt to the TFTP server at 1.1.3.214 and save it as temp.txt.
<H3C> tftp 1.1.3.214 put config.txt temp.txt