Puppet: System Administration Automated

Support

Ticket #1164 (closed defect: worksforme)

Opened 8 months ago

Last modified 8 months ago

sshkey type is creating invalid ssh_known_hosts file

Reported by: plathrop Assigned to: community
Priority: normal Milestone:
Component: library Version: 0.24.4
Severity: normal Keywords:
Cc: Triage Stage: Needs more info
Attached Patches: None Complexity: Unknown

Description

In 0.24.4 I am using the sshkeys type like so:

  @@sshkey { $hostname: type => rsa, key => $sshrsakey }
  Sshkey <<| |>>

The file that is created looks like this:

d65 ssh-rsa ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0lpvC7a0w1c6dCYBVWfsbPI2A8WW/7/CFdSnU3vIOTFb25/XB/hnz8+ZqLAawAybokCCA2aF6sHKs7Aa2AAG0BLGmZHDI4I1ca5p01r+6C6N62MKZHWvsu7dOv+Ii3s5RGT85rEnnNr2T636gVew9jN8vogRW/rHseunocqgqV/JIUuwZocr6z8pIUQjIos2nNB1u4VqkSjG7r49QU1PFPhlg5C3Q7VeIgH1A9FfAb0Pqcx8qARj5P+V7sNZsvk3F6aSW3Oh9sumMzsfauTATtaXTHcKfmdB5h8VwzbbGIr0IpJeHkpaqvIM3JdmvbRCFDYCy5D8VRfENKV7awPR2w== root@d65
admin ssh-rsa ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAxV9yiDdYaVdqjrUlNjvyF9QmJV96VwntJB+6i4620z8RH6gBu7qAggvSL/3oZ9aKG60/c97/fIpXxSnOF3sNRsk/o5rGNVZ6zbrHQVdMQ/qogitEVfSQxYtndQPn6+bXVaYgirAVynfcLgmBNwjZoGObEJ/cjX5NVXFPmtJou48= root@d14

As you can see, this is an invalid format. The 'ssh-rsa' is repeated, causing ssh to give this error:

d65:~# ssh admin
key_read: uudecode ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAxV9yiDdYaVdqjrUlNjvyF9QmJV96VwntJB+6i4620z8RH6gBu7qAggvSL/3oZ9aKG60/c97/fIpXxSnOF3sNRsk/o5rGNVZ6zbrHQVdMQ/qogitEVfSQxYtndQPn6+bXVaYgirAVynfcLgmBNwjZoGObEJ/cjX5NVXFPmtJou48= root@d14
 failed

Change History

03/29/08 04:36:25 changed by jamtur01

  • stage changed from Unreviewed to Needs more info.

I can't replicate this error. Running this configuration gives me a normally formatted ssh_known_hosts.

What platform is this? Anything odd about it?

03/29/08 22:48:39 changed by plathrop

Debian Etch with some backported packaged (Puppet among them).

Nothing odd that I can put a finger on. I'll hammer on this and see if I can reproduce it in a VM...

04/09/08 01:40:19 changed by btm

This happened to me too.

type => rsa adds 'ssh-rsa', so if you have 'ssh-rsa' in $sshrsakey along with the key itself, you'll end up with it twice. I removed 'ssh-rsa' from my key variable and all was well.

04/09/08 02:44:47 changed by luke

  • status changed from new to closed.
  • resolution set to worksforme.