back

authorized-keys

add and removed ssh authorized keys to users accounts

Overview

  • This module manages users' ssh authorized key lists.

  • It can add a key to an authorized_keys file.

  • It can ensure a key is not present in an authorized_keys file.

  • It can return all the public keys in the authorized_keys file.

Form

(authorized-keys command options)

Arguments

command

The operation to execute. Should be one of :present, :absent or :get

:present

Ensure the specified key is in the authorized_keys file

options

A hashmap of options. All available options and their values are described below

Options

OptionDescription
:user
type string

    The username of the user to receive the credential in their authorized_keys file

:key
type string

    The public key contents to add or remove from the file

:file
type string

    Instead of specifying a user, specify the location of an authorized_keys file to work with

:options
type string

    A hashmap containing a set of ssh key options that will be prepended to the key in the authorized_keys file.

Examples