Module authorized_keys

Ensure that an SSH key is present or absent in a specified user's authorized_keys file.

Info:

Functions

present(user, id, type, options, create)
Add key to a user's authorized_keys file.
All matching base64 encoded keys are removed first before adding the specificied key. See the AUTHORIZED_KEYS FILE FORMAT section in sshd(8)

Promiser:

    base64 encoded key

Note:

    this note

Parameters:

  • user user to operate on [ALIAS: login] [DEFAULT: Effective user ID]
  • id a string usually used to comment or identify a key
  • type SSH key type [REQUIRED]
  • options a comma-separated options specifications
  • create create ~/.ssh directory or not [DEFAULT: "yes", true]

Usage:

    authorized_keys.present("AAAAA...."){
        options = "yaaaya",
           user = "ed",
             id = "etongson",
           type = "ssh-rsa",
         create = false
    }
absent(user, type)
Remove key from a user's authorized_keys file.

Promiser:

    base64 encoded key

Parameters:

  • user user to operate on [ALIAS: login] [DEFAULT: Effective user ID]
  • type SSH key type

Usage:

    authorized_keys.absent"AAAAA..."{
        user = "ed",
        type = "ssh-rsa"
    }
generated by LDoc 1.4.6 Last updated 2017-05-09 15:50:38