HomePhabricator

Correct private key permissions before extracting public key in bin/almanac…

Description

Correct private key permissions before extracting public key in bin/almanac register

Summary: ssh-keygen declines to run on a too-public key. Write the correctly-restricted key a little earlier in the workflow.

Test Plan:

epriestley@orbital ~/dev/phabricator $ chmod 644 ~/dev/core/conf/keys/daemon.key
epriestley@orbital ~/dev/phabricator $ ./bin/almanac register --private-key ~/dev/core/conf/keys/daemon.key --identify-as local.phacility.net --device daemon.phacility.net --force --allow-key-reuse
Installing public key...
Installing private key...
Installing device ID...
 HOST REGISTERED  This host has been registered as "local.phacility.net" and a trusted keypair has been installed.
epriestley@orbital ~/dev/phabricator $

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11700