Page MenuHomeVyOS Platform

system users can not be added in "edit"
Needs testing, Requires assessmentPublicBUG

Description

vyos@vyos# edit system login
vyos@vyos# set user foo authentication plaintext-password bar
vyos@vyos# commit
Configuration path: [system login user foo authentication plaintext-password] is not valid

Delete failed
Configuration path: [system login user foo authentication encrypted-password $6$VDzi4CPNprXbQM4Z$jcuC1d5Gh8Xjr3be4K.GDND8aROjXmJHvD11aZj1LojruvwCpvY66PEcu4qoD6X1VW1GaSMh3.BthvSDJIsQU1] is not valid

Set failed

Runing the same command not from edit works

vyos@vyos# set system login user foo authentication plaintext-password bar
vyos@vyos# commit

Details

Difficulty level
Unknown (require assessment)
Version
1.3.0-rc1
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

c-po updated the task description. (Show Details)
c-po updated the task description. (Show Details)
c-po renamed this task from edit mode breaks adding system users to system users can not be added in "edit".Fri, Apr 2, 9:41 PM

We can do some workaround for that level,

lvl = env['VYATTA_EDIT_LEVEL']
if lvl != '/':
    lvl = lvl.replace(lvl, ' ')
    call(f"/opt/vyatta/sbin/my_delete {lvl} user '{user}' " \
         f"authentication plaintext-password", env=env)
    call(f"/opt/vyatta/sbin/my_set {lvl} user '{user}' " \
         f"authentication encrypted-password '{encrypted_password}'", env=env)
else:
    call(f"/opt/vyatta/sbin/my_delete system login user '{user}' " \
         f"authentication plaintext-password", env=env)
    call(f"/opt/vyatta/sbin/my_set system login user '{user}' " \
         f"authentication encrypted-password '{encrypted_password}'", env=env)

But how about other levels, we get the same error for example with "edit system login user foo"

PR https://github.com/vyos/vyos-1x/pull/802

vyos@r4-roll# edit system login 
[edit system login]
vyos@r4-roll# set user foo authentication plaintext-password bar
[edit system login]
vyos@r4-roll# commit
[edit system login]
vyos@r4-roll# show user foo 
 authentication {
     encrypted-password $6$qpdouYBuwFjsVzBB$Zu3sf9yQgNRCJUtM2E5F955xKchpMkEnA61fVo3ZLfJ2Y.pwdFOuoKSUGWtiB/YXxJmYnCEQyhzvLw5GZdQLB1
 }
[edit system login]
vyos@r4-roll#
Viacheslav changed the task status from Open to Needs testing.Tue, Apr 13, 5:10 PM