Skip to content

Commit

Permalink
boot-config-loader: T1622: add missing groups to failsafe user
Browse files Browse the repository at this point in the history
This extends commit 86d1291 ("[boot-config-loader] T1622: Add failsafe
and back trace") and adds missing groups to the vyos user. Without this
change the vyos user will only have operator (vyos@vyos>) privileges,
even if this level is discontinued.

One could hack himself up as the user has sudo rights, but rather place
the user in the right groups from the beginning.

NOTE: This user is only added if booted with "vyos-config-debug" and
an error when the configuration can not be loaded at all.
  • Loading branch information
c-po committed Jan 9, 2024
1 parent fc6926f commit 07e802a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/helpers/vyos-boot-config-loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def failsafe(config_file_name):
'authentication',
'encrypted-password'])

cmd(f"useradd -s /bin/bash -G 'users,sudo' -m -N -p '{passwd}' vyos")
cmd(f"useradd --create-home --no-user-group --shell /bin/vbash --password '{passwd}' "\
"--groups frr,frrvty,vyattacfg,sudo,adm,dip,disk vyos")

if __name__ == '__main__':
if len(sys.argv) < 2:
Expand Down

0 comments on commit 07e802a

Please sign in to comment.