Skip to content

known_host port format fails for some linux distributions #73

@wwoodrow

Description

@wwoodrow

Amazon linux new AMI 2017.09 breaks when using hashed entries with alternate ports, or rather ignores them. As far as I've found the []:port# isn't needed and the known_host file works fine on the few linux distros I've checked without them. The fix that worked for me was to simply strip out the added syntax returned from the call to ssh-keyscan for non-standard ports. This also makes matching easier basically just an added conditional with regex and all was fine:

if new_resource.port == 22
new_resource.key keyscan.stdout.strip
else
new_resource.key keyscan.stdout.strip.sub(/[(.)].+(ssh.)/, '\1 \2')
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions