How to use the command shell

edtFTPj/PRO provides a powerful command shell that enables users to manually execute a series of FTP commands in a similar way to Windows' ftp.exe client or ftp on Unix. The difference is that edtFTPj/PRO's command shell is cross-platform (it will run wherever Java can be installed) and supports both types of secure FTP: FTPS (FTP over SSL) and SFTP (FTP over SSH).

The command shell is started by running the ftpshell.bat (or ftpshell on Unix). No options need be supplied, although there are a variety of options that are described below:

ftpshell [user@]host[:port] [-c configfile] [-n] [-h] [-p password] [-o protocol] [-v]
    
-c configfile	configuration script to run before connecting. Any commands may be used, including open.
-n 	do not connect to the server (default is to connect if credentials and host supplied)
-h	display the help
-p  password	set the user password
-o  protocol	set the protocol: ftp|ftps|ftpsi|sftp
    ftp - standard FTP (the default)
    ftps - FTP over SSL (explicit)
    ftpsi - FTP over SSL (implicit)
    sftp - FTP over SSH
-v	print version details

If no options are supplied, the standard prompt appears and commands can be entered:

ftp> 

At this point, the shell is not connected as a host has not been specified. If instead the shell was started with:

ftpshell javaftp@edtlinux1:21 -p javaftp 

then as there is sufficient information (host, username, password) then a connection is opened to the specified host (called edtlinux1 in this instance) on port 21, and an attempt to establish a standard FTP session will be made. If connection and login is successful, the user will be informed of this.

If '-o ftps' was supplied in addition to the parameters above, a secure FTPS session would have been opened instead, provided that an FTPS server was available at the standard port for this host. In this case the command prompt would reflect that it is a secure session:

ftps> 

Once a connection has been established, the usual FTP commands (and many additional commands) can be executed as detailed in the command reference. If insufficient details have been provided as command-line parameters to enable a connection and login to be made, the open command can be used to open a connection within the shell, e.g.

open edtlinux1 

In this case the set commmand would need to have been used to set the username and password prior to calling open.

Once all the operations required have been completed, the connection can be closed by the close, quit or bye commands. The user will still be within the shell, and open command can be used to re-open a connection. The set command can be used to reset parameters so that a new host can be logged into, or the close, quit or bye commands can be used again to exit the shell session.