2012-11-30 10:59:38 +00:00
|
|
|
cdist-type__ssh_authorized_keys(7)
|
|
|
|
==================================
|
2016-06-23 14:08:59 +00:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
cdist-type__ssh_authorized_keys - Manage ssh authorized_keys files
|
2012-11-30 10:59:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
Adds or removes ssh keys from a authorized_keys file.
|
|
|
|
|
2014-09-25 14:16:15 +00:00
|
|
|
This type uses the __ssh_dot_ssh type to manage the directory containing
|
|
|
|
the authorized_keys file. You can disable this feature with the --noparent
|
|
|
|
boolean parameter.
|
2012-11-30 10:59:38 +00:00
|
|
|
|
|
|
|
The existence, ownership and permissions of the authorized_keys file itself are
|
|
|
|
also managed. This can be disabled with the --nofile boolean parameter. It is
|
2014-09-25 14:16:15 +00:00
|
|
|
then left to the user to ensure that the file exists and that ownership and
|
2012-11-30 10:59:38 +00:00
|
|
|
permissions work with ssh.
|
|
|
|
|
|
|
|
|
|
|
|
REQUIRED PARAMETERS
|
|
|
|
-------------------
|
2016-05-20 06:50:56 +00:00
|
|
|
key
|
2012-11-30 10:59:38 +00:00
|
|
|
the ssh key which shall be added to this authorized_keys file.
|
|
|
|
Must be a string and can be specified multiple times.
|
|
|
|
|
|
|
|
|
|
|
|
OPTIONAL PARAMETERS
|
|
|
|
-------------------
|
2016-05-20 06:50:56 +00:00
|
|
|
comment
|
2014-09-25 14:16:15 +00:00
|
|
|
explicit comment instead of the one which may be trailing the given key
|
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
file
|
2014-09-25 14:16:15 +00:00
|
|
|
an alternative destination file, defaults to ~$owner/.ssh/authorized_keys
|
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
option
|
2014-09-25 14:16:15 +00:00
|
|
|
an option to set for all created authorized_key entries.
|
|
|
|
Can be specified multiple times.
|
|
|
|
See sshd(8) for available options.
|
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
owner
|
2012-11-30 10:59:38 +00:00
|
|
|
the user owning the authorized_keys file, defaults to object_id.
|
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
state
|
2012-11-30 10:59:38 +00:00
|
|
|
if the given keys should be 'present' or 'absent', defaults to 'present'.
|
|
|
|
|
|
|
|
|
|
|
|
BOOLEAN PARAMETERS
|
|
|
|
------------------
|
2016-05-20 06:50:56 +00:00
|
|
|
noparent
|
2012-11-30 10:59:38 +00:00
|
|
|
don't create or change ownership and permissions of the directory containing
|
|
|
|
the authorized_keys file
|
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
nofile
|
2012-11-30 10:59:38 +00:00
|
|
|
don't manage existence, ownership and permissions of the the authorized_keys
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
EXAMPLES
|
|
|
|
--------
|
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
# add your ssh key to remote root's authorized_keys file
|
|
|
|
__ssh_authorized_keys root \
|
|
|
|
--key "$(cat ~/.ssh/id_rsa.pub)"
|
|
|
|
|
|
|
|
# allow key to login as user-name
|
|
|
|
__ssh_authorized_keys user-name \
|
|
|
|
--key "ssh-rsa AXYZAAB3NzaC1yc2..."
|
|
|
|
|
|
|
|
# allow key to login as user-name with options and expicit comment
|
|
|
|
__ssh_authorized_keys user-name \
|
|
|
|
--key "ssh-rsa AXYZAAB3NzaC1yc2..." \
|
|
|
|
--option no-agent-forwarding \
|
|
|
|
--option 'from="*.example.com"' \
|
|
|
|
--comment 'backup server'
|
|
|
|
|
|
|
|
# same as above, but with explicit owner and two keys
|
|
|
|
# note that the options are set for all given keys
|
|
|
|
__ssh_authorized_keys some-fancy-id \
|
|
|
|
--owner user-name \
|
|
|
|
--key "ssh-rsa AXYZAAB3NzaC1yc2..." \
|
|
|
|
--key "ssh-rsa AZXYAAB3NzaC1yc2..." \
|
|
|
|
--option no-agent-forwarding \
|
|
|
|
--option 'from="*.example.com"' \
|
|
|
|
--comment 'backup server'
|
|
|
|
|
|
|
|
# authorized_keys file in non standard location
|
|
|
|
__ssh_authorized_keys some-fancy-id \
|
|
|
|
--file /etc/ssh/keys/user-name/authorized_keys \
|
|
|
|
--owner user-name \
|
|
|
|
--key "ssh-rsa AXYZAAB3NzaC1yc2..."
|
|
|
|
|
|
|
|
# same as above, but directory and authorized_keys file is created elswhere
|
|
|
|
__ssh_authorized_keys some-fancy-id \
|
|
|
|
--file /etc/ssh/keys/user-name/authorized_keys \
|
|
|
|
--owner user-name \
|
|
|
|
--noparent \
|
|
|
|
--nofile \
|
|
|
|
--key "ssh-rsa AXYZAAB3NzaC1yc2..."
|
2012-11-30 10:59:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
2016-06-30 13:12:32 +00:00
|
|
|
:strong:`sshd`\ (8)
|
2016-06-17 19:28:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
AUTHORS
|
|
|
|
-------
|
|
|
|
Steven Armstrong <steven-cdist--@--armstrong.cc>
|
2012-11-30 10:59:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
COPYING
|
|
|
|
-------
|
2016-08-10 16:15:54 +00:00
|
|
|
Copyright \(C) 2012-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.
|