< Home

ssh user sftp-directory

Function

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.

Format

ssh user username sftp-directory directoryname

undo ssh user username sftp-directory

Parameters

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.

Views

System view

Default Level

3: Management level

Usage Guidelines

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.

Example

# Configure the SFTP service authorized directory flash:/ssh for the SSH user admin.

<HUAWEI> system-view
[HUAWEI] ssh user admin sftp-directory flash:/ssh
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >