Page MenuHomeVyOS Platform

generate-public-key command fails for address with multiple public keys like GitHub
Closed, ResolvedPublicBUG

Description

Using the generate-public-key command with a URL that containers multiple keys like GitHub's fails:

vyos@vyos:~$ generate public-key-command user vyos path https://github.com/doctorpangloss.keys
Failed to retrieve the public key: too many values to unpack (expected 3)

This is useful to provision keys easily. Similar to Ubuntu's installer's behavior.

show version

Version:          VyOS 1.3-rolling-202302030433
Release train:    equuleus

Built by:         root@3ab164b2e748
Built on:         Fri 03 Feb 2023 04:33 UTC
Build UUID:       1d0cfbb5-f29b-45d0-badb-7eb523bfffb0
Build commit ID:  3da60940f8229c

Architecture:     x86_64
Boot via:         installed image
System type:      bare metal

Hardware vendor:  HP
Hardware model:   HP EliteDesk 800 G5 Desktop Mini
Hardware S/N:     MXL95025NY
Hardware UUID:    800b5dc3-e6c8-ba65-0bcb-dc6bfdfbccb2

Copyright:        VyOS maintainers and contributors

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.3-rolling-202302030433
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Improvement (missing useful functionality)

Event Timeline

Viacheslav added a subscriber: Viacheslav.

Do those keys always without an "identifier"?
I mean foo@localhost

ssh-rsa AAA....

ssh-rsa AAAA...   foo@localhost

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

vyos@r14:~$ generate public-key-command user foo path https://github.com/xxxxx.keys
# To add this key as an embedded key, run the following commands:
configure
set system login user foo authentication public-keys github@39e9c9ba-408d-4b4b-9aa6-d07f531285bf key xxxxx
set system login user foo authentication public-keys github@39e9c9ba-408d-4b4b-9aa6-d07f531285bf type ssh-rsa
set system login user foo authentication public-keys github@4732d9b0-4bc5-47d1-9028-0e68348a932f key xxxxx
set system login user foo authentication public-keys github@4732d9b0-4bc5-47d1-9028-0e68348a932f type ssh-rsa
set system login user foo authentication public-keys github@a93a85ba-5b63-4c3a-a589-2e82da7c8f1f key xxxxx
set system login user foo authentication public-keys github@a93a85ba-5b63-4c3a-a589-2e82da7c8f1f type ssh-rsa
commit
save
exit
vyos@r14:~$
Viacheslav changed the task status from Open to In progress.Feb 25 2023, 10:49 PM
Viacheslav claimed this task.