SysAdmin | sys·ad·min | noun - A system administrator. The duties of a system administrator are wide-ranging, and vary widely from one organization to another. Sysadmins are usually charged with installing, supporting, and maintaining servers or other computer systems, and planning for and responding to service outages and other problems.

Adding an SSH private key to an encrypted data bag

on May 13, 2015 | Notes-to-self | 1619 comments

Replace newlines in key with \n:

sed ':a;N;$!ba;s/\n/\\n/g' </path/to/key/file>

Add databag item:

knife data bag create private ssh_key --editor vi --secret-file /etc/chef/encrypted_data_bag_secret

"id": "ssh_key"
"key": "<paste output from sed here>"