Package: claviger
clavigerclavigermanages the SSHauthorized_keysfiles for you.Quick introductionTellclavigerwhich keys you want to put on which server
by creating a~/.claviger-file.  An examplekeys:laptop:ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINYZEwjtu8w9Hsvx85TlYE95MLV9Whc3N1ajrH7+gu7Adesktop:ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICUef9frJIX7tjvZkYYMtr4IdD/GcKz6/X5qvLxM1Z8O desktopwork:ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICrycv44eyFwWJ7QQsGOnjEiAsFSdxIoAEzBPSO/AQB5 workservers:myprivateserver.com:user:myusernamepresent:-laptop-desktoproot@myotherserver.com:like:myprivateserver.compresent:-workkeepOtherKeys:falseworkuser@workserver.com:present:-work-desktopabsent:-laptopThen runclaviger.  By defaultclavigeronly tells which changes
it wants to make, but does not make them.  If the changes seem fine,
runclaviger-f, which allowsclavigerto make changes.InstallationTo installclaviger, simply run:pip install clavigerClaviger config fileA.clavigeris written inYAML.  It consists of two maps: thekeysmap and theserversmap.servers:server_key:# ... (server stanza)server_key2:# ... (server stanza)keys:key_name:# ... (ssh public key)key_name2:# ... (ssh public key)As seen in the example at the top, thekeysmap has as values SSH
public keys as they would appear in anauthorized_keysfile.Theserversmap consists of key-stanza pairs.  Each stanza is a map
of option name/value pairs, like:server_key:option_name:option_valueoption_name2:option_value# ...See below for the available options in the server-stanza’s.Server keyThe key of a server stanza is of the following form:[user@]hostname[:port]Examples of keys arejust-a-hostname.nluser@some-server.comsome-server.nl:1234user@and-port.com:22022You can also specifyuser,hostnameandportexplicitly.
See below.If a server key starts with a dollar sign (for instance$work),
then it is consideredabstract— see below.Server stanzasA server stanza is a map which may have the following entries.nameThe name of the server.Default: stanza key.hostnameThe hostname of the server.Default: derived from stanza key.userThe user for which to manage theauthorized_keysfileDefault:rootif not derived from stanza key.presentA list of key names that must be in theauthorized_keysfile.Default: the empty list[]absentA list of SSH-keys that should be removed from theauthorized_keysfile.Default: the empty list[]keepOtherKeystrueorfalse.  If set tofalse,clavigerwill remove all keys not explicitly allowed form theauthorized_keysfile.Default:true.allowA list of SSH-keys that are also allowed to be in theauthorized_keysfile ifkeepOtherKeysis set
tofalse.  These keys will not be added, if
not present already.Default: the empty list[]likeName of another server stanza.  If set, the entries of
the other server stanza will be used as default values
for this server stanza.Default:$defaultssh_userThe user to use to get and put theauthorized_keysfile.Default: the same asuserportThe port to use to connect to the server.Default: 22.abstracttrueorfalse. If set totrue,clavigerwill not check this server.  See below.Default:falseAbstract servers and$defaultclavigerwill not check anabstractserver.  This is useful to cleanly
configure multiple server.servers:$mine:keepOthers:falsepresent:-my_first_key-my_second_key$work:present:-my_work_keyabsent:-my_first_keymy-first-server.tld:like:$minemy-second-server.tld:like:$minealpha.at-work.tld:like:$workbeta.at_work.tld:like:$workBy default, server inherits from the hidden$defaultabstract server.servers:$default:user:mynamepresent:-this_key_is_put_everywherehost1.tld:# will use myname as userhost2.tld:# "root@host3.tld# will use root as userhost4.tld:absent:-this_key_is_put_everywhere# except hereclaviger Changelog0.2.1 (2016-03-15)Add missing dependency to jsonschema.  (Thanks-to: Joost Rijneveld)Properly decode output ofscp.  (Thanks-to: Joost Rijneveld)0.2 (2016-01-14)Addallow-list to server stanza.IfkeepOtherKeysis set to false, claviger will remove any keys present
except for those in thepresentandallowlist.Addabstract servers.  Let every server inherit from the hidden
abstract server$default.Allowservers:server1:server2:which is prettier thanservers:server1:{}server2:{}bugfix: actually set server name withnameoption.0.1.2 (2016-01-08)Show the correct number of keys actually removed.0.1.1 (2015-12-21)Some cosmetic changes.Show example configuration file, if claviger isn’t configured yet.Python 3 compatibility.0.1.0 (2015-12-14)Initial release.