Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I validate a salt minion's key fingerprint before accepting it on the master?

Tags:

salt-stack

When I build a new server, I collect the ssh key fingerprints from the console before my initial connections over the network using ssh. I'd like to be able to get the same out-of-band assurance when using salt.

With salt, when a new minion starts up it generates an RSA key and submits a request to the salt-master. I can use salt-key -p <newminion> to see the entire key and compare that with the minion's /etc/salt/pki/minion/minion.pub, but I'd rather use the shorter fingerprint that salt-key -f <newminion> displays.

How can I get the minion to display its own key fingerprint? The minion doesn't have the salt-key command ...

like image 257
Jim Cheetham Avatar asked Aug 05 '14 00:08

Jim Cheetham


People also ask

How do you accept keys on Salt master?

To change the state of a minion key, use -d to delete the key and then accept or reject the key.

What is the command you must enter to setup your machine as a Salt master?

Once you verify that those values are the same, you can accept the key by typing: sudo salt-key -a saltmaster.

When configuring a Salt master what is the function of a minion?

Configures how often, in seconds, the minion will verify that the current master is alive and responding. The minion will try to establish a connection to the next master in the list if it finds the existing one is dead.


1 Answers

Run salt-call in local mode on the minion asking for key.finger:

salt-call --local key.finger

If your salt is old or you otherwise don't have key.finger, you can use cat, grep and md5sum as noted in issue 3706:

cat /etc/salt/pki/minion/minion.pub | grep -v -e BEGIN -e END | md5sum
like image 109
jla Avatar answered Oct 18 '22 07:10

jla