Connections to a remote FTP server are established using the ftpconnect command. The IP address of the remote server must be specified as the address string. The port number indicates the port where FTP connections are accepted by the remote server. The default port number for regular FTP connections is 21. The username and password strings are required to log into a specific user account. If the FTP server allows anonymous access, the username should be ftp and the password should be the user's email address. Some legacy FTP servers may also require an optional account string. The ftpresult predefined status flag is set to the predefined constant success if the command completed successfully.
The syntax is
|
Secure connections using the SSL protocol (also known as FTPS) are established using the ftpconnectssl command. The ftpconnectsslc command can be used if only the control connection needs to be encrypted using SSL.
The syntax is
|
Secure connections using the SSH protocol (also known as SFTP) are established using the ftpconnectssh command. The default port number for ssh connections is 22.
The syntax is
|
Public key authentication for SSH connections allows clients to use a private key for authentication instead of a password. The pkeyload command enables a private key to be loaded to perform SSH public key authentication. The key must be loaded before establishing a connection using ftpconnectssh and must be in the pem format.
The syntax is
|
The ftpdisconnect command is used to close a connection that was established using any of the above commands.
The syntax is
|
Some examples are
|