---
name: "cdist-type__ssh_authorized_key"
section: "7"
platform: "linux"
package: "cdist"
version: "7.0.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/cdist-type__ssh_authorized_key"
---

# cdist-type\_\_ssh\_authorized\_key(7)

Manage a single ssh authorized key entry

## NAME

cdist-type\_\_ssh\_authorized\_key - Manage a single ssh authorized key entry

## DESCRIPTION

Manage a single authorized key entry in an authorized\_key file. This type was created to be used by the \_\_ssh\_authorized\_keys type.

## REQUIRED PARAMETERS

- **file**

  The authorized\_keys file where the given key should be managed.

- **key**

  The ssh key which shall be managed in this authorized\_keys file. Must be a string containing the ssh keytype, base 64 encoded key and optional trailing comment which shall be added to the given authorized\_keys file.

## OPTIONAL PARAMETERS

- **comment**

  Use this comment instead of the one which may be trailing in the key.

- **option**

  An option to set for this authorized\_key entry. Can be specified multiple times. See [sshd(8)](/sshd/8.md) for available options.

- **state**

  If the managed key should be 'present' or 'absent', defaults to 'present'.

## MESSAGES

- **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

```
__ssh_authorized_key some-id \
   --file "/home/user/.ssh/autorized_keys" \
   --key "$(cat ~/.ssh/id_rsa.pub)"
__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'
```

## SEE ALSO

[**cdist-type\_\_ssh\_authorized\_keys**(7)](/cdist-type__ssh_authorized_keys/7.md), [**sshd**(8)](/sshd/8.md)

## AUTHORS

Steven Armstrong \<*steven-cdist--@--armstrong.cc*\>

## 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.

## COPYRIGHT

ungleich GmbH 2021
