CDIST-TYPE__SSH_AUTHORIZED_KEY(7)

πŸ’– cdist-type__ssh_authorized_key(7) πŸ’–

okay bestie, so this is a cdist type page, and no bc it's not in the normal section 1, it's section 7, iykyk. anyway. we're talking about cdist-type__ssh_authorized_key and it does exactly one (1) thing: it manages a single ssh authorized key entry. that's it. one entry. one. πŸŽ€


✨ NAME ✨

cdist-type__ssh_authorized_key β€” manage a single ssh authorized key entry, bestie. just the one. πŸ’…


🌸 DESCRIPTION 🌸

so like, this type manages one authorized key entry in an authorized_key file. literally one. don't come at it asking for more, it's not that kind of type. πŸ™ˆ

and the whole reason it exists? it was created to be used by the __ssh_authorized_keys type. it's the little helper guy. the supporting character. the bestie behind the bestie. 🫢


πŸ’– REQUIRED PARAMETERS πŸ’–

these are not optional, queen. you need them.

  • file β€” the authorized_keys file where the given key should be managed. that's the whole vibe, it needs a home.
  • key β€” the ssh key which shall be managed in this authorized_keys file. and listen, it must be a string containing the ssh keytype, the base 64 encoded key, and an optional trailing comment which shall be added to the given authorized_keys file. so like, all three parts, okay? no shortcuts. ⭐

✨ OPTIONAL PARAMETERS ✨

these ones are the ~extra credit~, the accessories to the outfit:

  • comment β€” use this comment instead of the one which may be trailing in the key. like, if you wanna override the built-in one, go off.
  • option β€” an option to set for this authorized_key entry. and the slay part? it can be specified multiple times. see sshd(8) for available options. stack them like bracelets. πŸ’…
  • state β€” if the managed key should be 'present' or 'absent'. defaults to 'present'. so if you don't say anything, the key is staying. main character energy. πŸ‘‘

🌈 MESSAGES 🌈

this type is chatty, and here's what it says:

  • added to file (entry) β€” the key entry (with optional comment) was added to file. πŸ’–
  • removed from file (entry) β€” the key entry (with optional comment) was removed from file. πŸ’€

πŸ¦‹ EXAMPLES πŸ¦‹

okay here's the tea, watch closely:

__ssh_authorized_key some-id \
   --file "/home/user/.ssh/autorized_keys" \
   --key "$(cat ~/.ssh/id_rsa.pub)"

and then the ✨glow up✨ version with options and a comment:

__ssh_authorized_key some-id \
   --file "/home/user/.ssh/autorized_keys" \
   --key "$(cat ~/.ssh/id_rsa.pub)" \
   --option 'command="/path/to/script"' \
   --option 'environment="FOO=bar"' \
   --comment 'one to rule them all'
ngl bestie, yes, it really does say autorized_keys in the examples up there. we are copying it character for character because that's the rule and i do not make the rules. 😭

πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, they're the friend group. 🌸


πŸŽ€ AUTHORS πŸŽ€

Steven Armstrong <steven-cdist--@--armstrong.cc> β€” the icon who made this. periodt. πŸ’œ


🌟 COPYING 🌟

Copyright (C) 2014 Steven Armstrong. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. fr fr, that's the actual legal text, i'm not paraphrasing the license, that would be unhinged. 🫢


ungleich GmbH 2021 β€” okay so that's the copyright line, and version 7.0.0 from Jul 31, 2022 is the vibe check date on this whole page. that's a wrap bestie, go manage exactly one key, mwah πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from