GeneBean
09/25/2025, 12:56 PMcreate_rfc4716_authorized_keys and exists because the ssh_authorized_keys type does not produce the format that is needed.
pubkeys = args[0]
keys_contents = ""
pubkeys.each { |pubkey|
cmd = "ssh-keygen -e -f /dev/stdin <<< \"#{pubkey}\""
# return cmd
key_contents = "\n" + `#{cmd}`
key_contents = key_contents.gsub(/^Comment:.*?$/, 'Comment: "Converted by create_rfc4716_authorized_keys.rb"')
keys_contents = keys_contents + key_contents
}
keys_contents = keys_contents + "\n"
return keys_contents