sftp server default-directory

Function

The sftp server default-directory command configures a default authorized SFTP server directory.

The undo sftp server default-directory command cancels the configuration of the default authorized SFTP server directory.

By default, no authorized SFTP server directory is available.

Format

sftp server default-directory sftpdir

undo sftp server default-directory [ sftpdir ]

Parameters

Parameter Description Value
sftpdir

Specifies a default SFTP server directory.

The value is a string of 1 to 255 characters.

Views

System view

Default Level

3: Management level

Task Name and Operations

Task Name Operations
ssh-server write

Usage Guidelines

Usage Scenario

When accessing the server through SFTP, you can access only the authorized directory on the SFTP server. You can use any of the following methods to configure the authorized directory. The priorities of the three methods are as follows in descending order:

  • Run the ssh user <user-name> sftp-directory <sftp-dir-path> command in the system view to configure an authorized SFTP server directory for the specified user.
  • Run the local-user <user-name> ftp-directory <directory> command in the AAA view to configure an authorized FTP server directory for the specified user.
  • Run the sftp server default-directory command in the system view to configure a global default authorized SFTP server directory.

The ssh user <user-name> sftp-directory <sftp-dir-path> command has the highest priority and takes effect only for specified SSH users. The sftp server default-directory command has the lowest priority and takes effect for all SSH users.

This command takes effect for both ipv4 and ipv6 SFTP servers.

Example

# Configure a default authorized SFTP server directory for SSH users.
<HUAWEI> system-view
[~HUAWEI] sftp server default-directory cfcard:
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >