< Home

ssh user sftp-directory

Function

The ssh user sftp-directory command configures the authorized directory of the SFTP service for SSH users.

The undo ssh user sftp-directory command cancels the authorized directory of the SFTP service for the SSH user.

By default, the authorized directory of the SFTP service for the SSH user is hda1:.

Format

ssh user username sftp-directory directoryname

undo ssh user username sftp-directory

Parameters

Parameter Description Value

username

Specifies the name of an SSH user.

The name is a string of 1 to 253 case-insensitive characters without a blank space.

directoryname

Specifies the directory name of the SFTP server.

The name is a string of 1 to 64 case-insensitive characters without a blank space.

Views

System view

Default Level

3: Management level

Usage Guidelines

A user can access only the authorized directory of the SFTP service. If the user does not exist, a new SSH user with the specified username is created and the configured authorized directory is adopted. If the configured directory does not exist, the SFTP client fails to connect to the SSH server. 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

# Set the SFTP service authorized directory of the USG6000E to hda1:/ssh for an SSH user named zhangsan.

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