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

NETCONF YANG API Reference

AR100, AR120, AR160, AR1200, AR2200, AR3200, and AR3600 V300R003

NETCONF YANG API Reference
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).
SSH Login Using a Simple Password

SSH Login Using a Simple Password

Data Model

The data model file matching the SSH login using a simple password is huawei-device.yang, quoted the definition in huawei-user-management.yang.

Table 3-2198 SSH login using a simple password

Node

Description

huawei-user-management/user-management:local-user

Indicates that the operation request (creating, deleting, and modifying) object is a local user. It is only used to contain sub-objects, but does not have any data meaning.

huawei-user-management/user-management/local-user/user-name

Indicates a local user name. The value is a string of 1 to 64 case-insensitive characters without any space, asterisk (*), quotation mark ("), or question mark (?). If the domain to which the local user belongs is configured, a maximum of 63 characters can be contained in the names of the local user and domain.

huawei-user-management/user-management/local-user/domain-name

Indicates the domain to which a local user belongs. The value is a string of 1 to 64 case-insensitive characters without any space, asterisk (*), quotation mark ("), or question mark (?). By default, a local user belongs to the domain default_domain.

huawei-user-management/user-management/local-user/privilege-level

Indicates the priority of a local user. The value is an integer that ranges from 0 to 15. A larger value indicates a higher priority.

huawei-user-management/user-management/local-user/service-type

Indicates the service type of a local user. SSH service type is required for SSH login.

huawei-user-management/user-management/local-user/password

Indicates the password of a local user. The value a string of 8 to 128 case-sensitive characters without any question mark (?) and space.

huawei-device:device/user-interfaces/user-interface

Indicates the user interface.

huawei-device:device/user-interfaces/user-interface/name

Indicates the user interface name. When a user logs in through Telnet or SSH, VTY user interface is required, and the first and last user interface number must be specified. The user interface number ranges from 0 to 4.

huawei-device:device/user-interfaces/user-interface/authentication-mode

Indicates the user interface authentication mode. SSH login is authenticated in AAA mode.

huawei-device/device/servers/stelnet-server

Indicates the SSH server.

huawei-device/device/servers/stelnet-server/enabled

Indicates the STelnet service status of the SSH server. The value is Boolean that can only be true or false. The value true indicates the STelnet service is enabled, and the value false indicates that the STelnet service is disabled.

huawei-device/device/servers/stelnet-server/service-port

Indicates the SSH server port number. The value can be 22 or any integer ranging from 1025 to 55535.

NOTE:

When port 22 is specified as the protocol port number for the SSH server, an SSH client can log in with no port number specified. If another port number is specified as the protocol port number for the SSH server, you must specify the port number used by the client to log in.

Configuring SSH Login Using a Simple Password

This section provides a sample of configuring SSH login using a simple password.

Table 3-2199 Configuring SSH login using a simple password

Operation

XPATH

edit-config:merge

huawei-device:device/servers/stelnet-server

huawei-device:device/user-interfaces/user-interface

huawei-user-management/user-management/local-user

Data Requirements
Table 3-2200 Configuring SSH login using a simple password

Item

Data

Description

STelnet service status of the SSH server

true

Enable the STelnet service on the SSH server, specify 1029 as the SSH server port number, and set the user interface name to vty, and the first and last user interface number to 0 and 4, respectively. Set AAA authentication for login to the user interface. Set the AAA local user name to huawei, user domain to the default domain default_domain, password to huawei1234, and user priority to 15. Specify SSH as the service type.

SSH server port number

1029

User interface name

vty 0 4

User interface authentication mode

aaa

AAA local user name

huawei

Local user domain

default_domain

Password

huawei1234

Priority

15

Service type

ssh

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="cf1228d1-c9bc-4e95-9578-4e7d0cd90e25"> 
 <edit-config> 
  <target> 
   <running/> 
  </target> 
  <config> 
   <device xmlns="urn:huawei:params:xml:ns:yang:huawei-device"> 
    <user-interfaces> 
     <user-interface> 
      <name>vty 0 4</name> 
      <authentication-mode>aaa</authentication-mode> 
     </user-interface> 
    </user-interfaces> 
    <servers> 
     <stelnet-server> 
      <enabled>true</enabled> 
      <service-port>1029</service-port> 
     </stelnet-server> 
    </servers> 
   </device> 
   <user-management xmlns="urn:huawei:params:xml:ns:yang:huawei-user-management"> 
    <local-user> 
     <user-name>huawei</user-name> 
     <domain-name>default_admin</domain-name> 
     <privilege-level>15</privilege-level> 
     <service-type>ssh</service-type> 
     <password>huawei1234</password> 
    </local-user> 
   </user-management> 
  </config> 
 </edit-config> 
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="cf1228d1-c9bc-4e95-9578-4e7d0cd90e25"> 
 <ok/> 
</rpc-reply>

Modifying the Configuration of SSH Login Using a Simple Password

This section provides a sample of modifying the configuration of SSH login using a simple password.

Table 3-2201 Modifying the configuration of SSH login using a simple password

Operation

XPATH

edit-config:replace

huawei-device:device/servers/stelnet-server

huawei-device:device/user-interfaces/user-interface

huawei-user-management/user-management/local-user

Data Requirements
Table 3-2202 Modifying the configuration of SSH login using a simple password

Item

Data

Description

STelnet service status of the SSH server

true

Change the SSH server port number from 1029 to 1033, login password from huawei1234 to huawei123, and user priority from 15 to 10. Retain the following configuration:

User interface name: vty

First and last user interface number: 0 and 4

Authentication mode: AAA

User name: huawei

Service type: SSH

Domain: default_domain

SSH server port number

1033

User interface name

vty 0 4

User interface authentication mode

aaa

AAA local user name

huawei

Local user domain

default_domain

Password

huawei123

Priority

10

Service type

ssh

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="cf1228d1-c9bc-4e95-9578-4e7d0cd90e25"> 
 <edit-config> 
  <target> 
   <running/> 
  </target> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
   <device xmlns="urn:huawei:params:xml:ns:yang:huawei-device"> 
    <user-interfaces xc:operation="replace"> 
     <user-interface> 
      <name>vty 0 4</name> 
      <authentication-mode>aaa</authentication-mode> 
     </user-interface> 
    </user-interfaces> 
    <servers xc:operation="replace"> 
     <stelnet-server> 
      <enabled>true</enabled> 
      <service-port>1033</service-port> 
     </stelnet-server> 
    </servers> 
   </device> 
   <user-management xmlns="urn:huawei:params:xml:ns:yang:huawei-user-management"> 
    <local-user xc:operation="replace"> 
     <user-name>huawei</user-name> 
     <domain-name>default_admin</domain-name> 
     <privilege-level>10</privilege-level> 
     <service-type>ssh</service-type> 
     <password>huawei123</password> 
    </local-user> 
   </user-management> 
  </config> 
 </edit-config> 
</rpc> 
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="cf1228d1-c9bc-4e95-9578-4e7d0cd90e25"> 
 <ok/> 
</rpc-reply>

Deleting the Configuration of SSH Login Using a Simple Password

This section provides a sample of deleting the configuration of SSH login using a simple password.

Table 3-2203 Deleting the configuration of SSH login using a simple password

Operation

XPATH

edit-config:remove

huawei-device:device/servers/stelnet-server

huawei-device:device/user-interfaces/user-interface

huawei-user-management/user-management/local-user

Data Requirements
Table 3-2204 Deleting the configuration of SSH login using a simple password

Item

Data

Description

STelnet service status of the SSH server

true

Delete the following configuration of SSH login using a simple password:

STelnet service status of the SSH server: enabled

SSH server port number: 1033

User interface name: vty

First and last user interface number: 0 and 4

Authentication mode: AAA

AAA local user name: huawei

User domain: default_domain

Password: huawei123

User priority: 10

Service type: SSH

SSH server port number

1033

User interface name

vty 0 4

User interface authentication mode

aaa

AAA local user name

huawei

Local user domain

default_domain

Password

huawei123

Priority

10

Service type

ssh

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="cf1228d1-c9bc-4e95-9578-4e7d0cd90e25"> 
 <edit-config> 
  <target> 
   <running/> 
  </target> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
   <device xmlns="urn:huawei:params:xml:ns:yang:huawei-device"> 
    <user-interfaces xc:operation="remove"> 
     <user-interface> 
      <name>vty 0 4</name> 
      <authentication-mode>aaa</authentication-mode> 
     </user-interface> 
    </user-interfaces> 
    <servers xc:operation="remove"> 
     <stelnet-server> 
      <enabled>true</enabled> 
      <service-port>1033</service-port> 
     </stelnet-server> 
    </servers> 
   </device> 
   <user-management xmlns="urn:huawei:params:xml:ns:yang:huawei-user-management"> 
    <local-user xc:operation="remove"> 
     <user-name>huawei</user-name> 
     <domain-name>default_admin</domain-name> 
     <privilege-level>10</privilege-level> 
     <service-type>ssh</service-type> 
     <password>huawei123</password> 
    </local-user> 
   </user-management> 
  </config> 
 </edit-config> 
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="cf1228d1-c9bc-4e95-9578-4e7d0cd90e25"> 
 <ok/> 
</rpc-reply>
Translation
Download
Updated: 2019-03-06

Document ID: EDOC1100022096

Views: 8536

Downloads: 69

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