UX: Handle Multiple SSH Keys/Recipients in Single Flag Input #255
mohammed90
started this conversation in
UX reports
Replies: 1 comment
-
This was implemented as |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What were you trying to do
Use
age
to encrypt a file with multiple SSH recipients in a single flag-passed-r, --recipient
value.What happened
(didn't "happened", rather cannot happen)
I'm trying to encrypt a file with multiple SSH recipients by grabbing their public SSH keys set on Github. The command is:
Currently, the
-r,--recipient
flag can be used multiple times to pass multiple keys. However, it doesn't expect a single passing to contain multiple keys, and discards therest
returned fromssh.ParseAuthorizedKey
(4th-positioned return value):age/internal/age/ssh.go
Lines 150 to 152 in bbab440
The
ssh.ParseAuthorizedKey
func will look for the first\n
, split the input at the point, and return the rest:https://github.com/golang/crypto/blob/53104e6ec876ad4e22ad27cce588b01392043c1b/ssh/keys.go#L178-L180
Without
-r,--recipient
accepting multiple SSH keys at once, user will either have to download the keys (i.e.wget https://github.com/<username>.keys
), split them into multiple files, and pass-r
as many times as the number of files resulting from splitting<username.keys>
; or they will have to use some clever shell tricks to split them and pass multiple-r
in a one-liner.Beta Was this translation helpful? Give feedback.
All reactions