SSH keys managed with Salt Stack

In short, you can manage SSH keys by adding these lines to a .sls file:

– present
– user: cedwards
– enc: ssh-rsa

The important bit is to paste in the public key followed by a colon (“:”). Instructions on creating an SSH private and public key pair:–2

Make sure you have created the user by putting this in the same file (or anywhere else if you prefer):

– password:

See this for info on getting the password hash for a user account. The above salt state doesn’t use the literal password. Rather, you paste in the password hash for that account.

I based this post off info I got here: