This section describes how to configure the FW as an SFTP server.
These SSH user authentication modes are available: RSA, DSA, ECC, password, password-RSA, password-DSA, password-ECC and all. Password authentication depends on Authentication, Authorization and Accounting (AAA). Before a user logs in to the device in password, password-ECC, password-RSA or password-DSA authentication mode, you must create a local user with the specified user name in the AAA view.
The device must be configured to generate local RSA, DSA or ECC key pairs, which are a key part of the SSH login process. If an SSH user logs in to an SSH server in password authentication mode, configure the server to generate a local RSA, DSA or ECC key pair. If an SSH user logs in to an SSH server in RSA, DSA or ECC authentication mode, configure both the server and the client to generate local RSA, DSA or ECC key pairs.
RSA key and DSA key are algorithms for user authentication in SSH. Compared with RSA authentication, DSA authentication adopts the DSA encryption mode and is widely used. In many cases, SSH only supports DSA to authenticate the server and the client. When the RSA, DSA or ECC authentication mode is used, the priority of the users depends on the priority of the VTY user interfaces used for login.
In all authentication mode, the user priority depends on the authentication mode selected.
If all authentication is selected and an AAA user with the same name as the SSH user exists, user priorities may be different in password authentication and RSA/DSA/ECC authentication modes. Set relevant parameters as needed.
sftp [ ipv4 | ipv6 ] server enable
You need to run the rsa local-key-pair create command to generate the local RSA key pair before performing other SSH configurations. The host key pair length and server key pair length range from 512 to 2048, in bits.
The default value is 2048 bit. As for version upgrade, if the original key pair length is smaller than 1024 bits, you are advised to run the command after the upgrade.
After creating a local RSA key pair, you can run the display rsa local-key-pair public command to view the public key in the local key pair.
You can run the rsa local-key-pair destroy to clear all local RSA key pairs, the host key pairs and host key pairs.
After running the rsa local-key-pair destroy command, check whether all local RSA key pairs are cleared. The command configuration takes effect only once and is not saved into the configuration file.
You need to run the dsa local-key-pair create command to generate the local DSA key pair before performing other SSH configurations. The host key pair length and server key pair length can be 1024 bits or 2048 bits. The default key pair length is 2048 bits.
After creating the local DSA key pair, you can run the display dsa local-key-pair public command to view the public key in the local key pair.
You can run the dsa local-key-pair destroy to clear all local DSA key pairs, the host key pairs and host key pairs.
After running the dsa local-key-pair destroy command, check whether all local DSA key pairs are cleared. The command configuration takes effect only once and is not saved into the configuration file.
Run the ecc local-key-pair create command to generate the ECC local-key-pair.
You must configure the ecc local-key-pair create command to generate a local key pair before completing other SSH configurations. The length of the host key pair can be 256, 384, 521 bits. By default, the length of the key pair is 521 bits.
After a local key pair is generated, you can run the display ecc local-key-pair public command to view the public key in the local key pair.
To clear the local ECC key pair, run the ecc local-key-pair destroy command to destroy all local DSA key-pairs.
Check whether all local ECC key pairs are destroyed after running the ecc local-key-pair destroy command. The ecc local-key-pair destroy command configuration takes effect only once and therefore will not be saved in the configuration file.
ssh user username
Configure the password authentication mode. |
NOTE:
The interactive mode is recommended for creating administrator passwords because the passwords configured using the cipher cipher-password command are not safe. |
Configure the RSA authentication mode. |
|
Configure the DSA authentication mode. |
|
Configure the ECC authentication mode. |
|
Configure the all authentication mode. |
The server can authenticate the client by checking both the public key and the password, and the authentication succeeds when either of them is consistent with that configured on the server. NOTE:
In all authentication mode, the user priority depends on the authentication mode selected.
If all authentication is selected and an AAA user with the same name as the SSH user exists, user priorities may be different in password authentication and RSA/DSA/ECC authentication modes. Set relevant parameters as needed. |
Configure the password-rsa authentication mode. |
Password-RSA authentication indicates that both password authentication and RSA authentication are implemented. |
Configure the password-dsa authentication mode. |
Password-DSA authentication indicates that both password authentication and DSA authentication are implemented. |
Configure the password-ecc authentication mode. |
Password-ECC authentication indicates that both password authentication and ECC authentication are implemented. |
Run the ssh user user-name authorization-cmd aaa command to configure command-specific authorization for a specific SSH user.
After configuring command-specific authorization for the SSH user, you need to configure AAA authorization. Otherwise, command-specific authorization does not take effect for the SSH user.
ssh user username service-type sftp
ssh user username sftp-directory directoryname
Set a service port number for the SFTP server. |
ssh server port port-number NOTE:
The port-number value ranges from 1025 to 55535. By default, the FW serving as the SFTP server uses port 22. |
Set the timeout duration of SFTP authentication. |
ssh server timeout seconds |
Set the number of SFTP authentication attempts. |
|
Set the interval for updating SFTP server key pairs. |
ssh server rekey-interval interval |
Enable the backward compatibility function. |
|
Specify a source interface. |
ssh server-source -i loopback interface-number |
Configure an ACL for the SSH server. |
|