The ssh user sftp-directory command configures the SFTP service authorized directory for an SSH user.
The undo ssh user sftp-directory command cancels the SFTP service authorized directory for an SSH user.
The default SFTP service authorized directory is flash: for an SSH user.
Parameter | Description | Value |
---|---|---|
username |
Specifies the SSH user name. |
The value is a string of 1 to 64 case-insensitive characters without spaces. |
directoryname |
Specifies the directory name on the SFTP server. |
The value is a string of 1 to 160 case-insensitive characters without spaces. |
Usage Scenario
If there is the default authorized directory for an SFTP user on the device, you can run this command to change the directory.
Precautions
Users can only access the specified directory on the SFTP server. If the username user does not exist, the system creates an SSH user named username and uses the SFTP service authorized directory configured for the user. If the configured directory does not exist, the SFTP client fails to connect to the SSH server using this SSH user. After a master/backup switchover or device restart is performed, the SFTP client fails to connect to the SSH server if the configured directory does not exist. In this case, check whether the configured directory is valid. If the configured directory is invalid, re-configure it.