No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S600-E V200R011C10 NETCONF YANG API Reference

This document describes the NETCONF API functions supported by the switch, including the data model and samples.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Configuring the SSH Server

Configuring the SSH Server

This section describes the configuration model of the SSH server and provides examples of XML packets.

Data Model

The configuration model files matching the SSH server are huawei-stelnet.yang and huawei-ssh-server.yang.

Table 2-53  Configuring the SSH server

Object

Description

Value

Remarks

/huawei-stelnet:server/enable

Enables the STelnet service.

The value is of the Boolean type:
  • true: enabled
  • false: disabled

N/A

/huawei-stelnet:client/first-time-enable

Enables the first authentication function on an SSH client.

The value is of the Boolean type:
  • true: enabled
  • false: disabled

N/A

/huawei-ssh-server:ssh-server/default-authentication-type

Indicates the SSH authentication type.

The value is of the enumerated type:
  • password: password authentication
  • none: The authentication type is not configured.

N/A

/huawei-ssh-server:ssh-server/user/name

Indicates the SSH user name.

The value is a string of 1 to 64 case-sensitive characters without spaces.

N/A

/huawei-ssh-server:ssh-server/user/authentication-type

Indicates the authentication mode of SSH users.

The value is of the enumerated type:

password: password authentication

N/A

/huawei-ssh-server:ssh-server/user/service-type

Indicates the service type of SSH users.

The value is of the enumerated type:

all: SFTP and STelnet service types

N/A

Enabling the STelnet Service

This section provides a sample of enabling the STelnet service using the config method.

Table 2-54  Enabling the STelnet service

Operation

XPATH

edit-config:config

/huawei-stelnet:server/enable

Data Requirements

Table 2-55  Enabling the STelnet service

Item

Data

Description

Whether the STelnet service is enabled

true

Enable the STelnet service.

Request Example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <stelnet:server xmlns:stelnet="urn:huawei:params:xml:ns:yang:huawei-stelnet">
        <stelnet:enable>true</stelnet:enable>
      </stelnet:server>
    </config>
  </edit-config>
</rpc>

Response Example

Sample of successful response

<?xml version='1.0' encoding='UTF-8'?> 
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> 
  <ok/> 
</rpc-reply>

Sample of failed response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-message>parse rpc config error.</error-message>
  </rpc-error>
</rpc-reply>

Enabling the first authentication function on an SSH client

This section provides a sample of enabling the first authentication function on an SSH client using the config method.

Table 2-56  Enabling the first authentication function on an SSH client

Operation

XPATH

edit-config:config

/huawei-stelnet:client/first-time-enable

Data Requirements

Table 2-57  Enabling the first authentication function on an SSH client

Item

Data

Description

Whether the first authentication function on an SSH client is enabled

true

Enable the first authentication function on an SSH client.

Request Example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <stelnet:client xmlns:stelnet="urn:huawei:params:xml:ns:yang:huawei-stelnet">
        <stelnet:first-time-enable>true</stelnet:first-time-enable>
      </stelnet:client>
    </config>
  </edit-config>
</rpc>

Response Example

Sample of successful response

<?xml version='1.0' encoding='UTF-8'?> 
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> 
  <ok/>
</rpc-reply>

Sample of failed response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-message>parse rpc config error.</error-message>
  </rpc-error>
</rpc-reply>

Configuring SSH Parameters

This section provides a sample of configuring SSH parameters using the config method.

Table 2-58  Configuring SSH parameters

Operation

XPATH

edit-config:config

  • /huawei-ssh-server:ssh-server/default-authentication-type
  • /huawei-ssh-server:ssh-server/user/name
  • /huawei-ssh-server:ssh-server/user/authentication-type
  • /huawei-ssh-server:ssh-server/user/service-type

Data Requirements

Table 2-59  Configuring SSH parameters

Item

Data

Description

SSH user

a

Set the SSH user name to a.

SSH authentication type

password

Set the SSH authentication type to password authentication.

Authentication mode of SSH users

password

Set the authentication mode of SSH users to password authentication.

Service type of SSH users

all

Set the service types of SSH users to SFTP and STelnet.

Request Example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <ssh:ssh-server xmlns:ssh="urn:huawei:params:xml:ns:yang:huawei-ssh-server">
        <ssh:default-authentication-type>password</ssh:default-authentication-type>
        <ssh:user>
          <ssh:name>a</ssh:name>
          <ssh:authentication-type>password</ssh:authentication-type>
          <ssh:service-type>all</ssh:service-type>
        </ssh:user>
      </ssh:ssh-server>
    </config>
  </edit-config>
</rpc>

Response Example

Sample of successful response

<?xml version='1.0' encoding='UTF-8'?> 
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> 
  <ok/> 
</rpc-reply>

Sample of failed response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-message>parse rpc config error.</error-message>
  </rpc-error>
</rpc-reply>
Translation
Download
Updated: 2019-03-30

Document ID: EDOC1000178028

Views: 4298

Downloads: 0

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next