From f37f3d201ce2174626ab41e47b4c93000a933dc4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 30 Nov 2012 14:41:47 +0100 Subject: [PATCH] __ssh_authorized_key has been superseeded by __ssh_authorized_keys Signed-off-by: Nico Schottelius --- .../explorer/dstuser_group | 15 ----- cdist/conf/type/__ssh_authorized_key/man.text | 46 ------------- cdist/conf/type/__ssh_authorized_key/manifest | 66 ------------------- .../__ssh_authorized_key/parameter/optional | 2 - 4 files changed, 129 deletions(-) delete mode 100644 cdist/conf/type/__ssh_authorized_key/explorer/dstuser_group delete mode 100644 cdist/conf/type/__ssh_authorized_key/man.text delete mode 100755 cdist/conf/type/__ssh_authorized_key/manifest delete mode 100644 cdist/conf/type/__ssh_authorized_key/parameter/optional diff --git a/cdist/conf/type/__ssh_authorized_key/explorer/dstuser_group b/cdist/conf/type/__ssh_authorized_key/explorer/dstuser_group deleted file mode 100644 index c79f8d9f..00000000 --- a/cdist/conf/type/__ssh_authorized_key/explorer/dstuser_group +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# Get option dstuser if defined -if [ -f "$__object/parameter/dstuser" ]; then - dstuser=`cat "$__object/parameter/dstuser"` -else - dstuser="root" -fi - -if id $dstuser >/dev/null 2>&1 ; then - id -ng $dstuser -else - echo "$__object_id: Destination user $dstuser does not exist" >&2 - exit 1 -fi diff --git a/cdist/conf/type/__ssh_authorized_key/man.text b/cdist/conf/type/__ssh_authorized_key/man.text deleted file mode 100644 index b372b354..00000000 --- a/cdist/conf/type/__ssh_authorized_key/man.text +++ /dev/null @@ -1,46 +0,0 @@ -cdist-type__ssh_authorized_key(7) -================================= -Aurélien Bondis - - -NAME ----- -cdist-type__ssh_authorized_key - Sends a user's public key to another user's authorized_keys - - -DESCRIPTION ------------ -This type sends a rsa key. By default uses root's key and sends it to root's authorized_keys - - -REQUIRED PARAMETERS -------------------- -None. - - -OPTIONAL PARAMETERS -------------------- -srcuser:: the user to take the rsa public key from -dstuser:: the user to give the rsa public key to - - -EXAMPLES --------- - --------------------------------------------------------------------------------- -#deploy root's public key -__ssh_authorized_key admin -#deploy bob's public key to alice's authorized_keys -__ssh_authorized_key --srcuser bob --dstuser alice --------------------------------------------------------------------------------- - - -SEE ALSO --------- -- cdist-type(7) - - -COPYING -------- -Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/cdist/conf/type/__ssh_authorized_key/manifest b/cdist/conf/type/__ssh_authorized_key/manifest deleted file mode 100755 index 86c58740..00000000 --- a/cdist/conf/type/__ssh_authorized_key/manifest +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -# -# 2011 Aurélien Bondis aurelien.bondis AT gmail DOT com -# -# This file is part of cdist. -# -# cdist is free software: 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. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# This type allows to send a public ssh key from a user to the -# authorized_keys of another -# -#require="__package openssh-server --state present" -# Get option srcuser if defined -if [ -f "$__object/parameter/srcuser" ]; then - srcuser=`cat "$__object/parameter/srcuser"` -fi -# Get option dstuser if defined -if [ -f "$__object/parameter/dstuser" ]; then - dstuser=`cat "$__object/parameter/dstuser"` -else - dstuser="root" -fi - -# retrieve destination group -dstgroup=$(cat "$__object/explorer/dstuser_group") - -# if a source user is defined, use it's public key -if [ "$srcuser" ]; then - srcrsa="/home/${srcuser}/.ssh/id_rsa.pub" -# if no source user is defined we use root's public key -else - srcrsa="/root/.ssh/id_rsa.pub" -fi -# if a destination user is defined, insert in it's authorized_keys -if [ "$dstuser" ]; then - sshpath="/home/$dstuser/.ssh" -# if no destination user is defined we use root's home -else - sshpath="/root/.ssh" -fi -rsa=`cat $srcrsa` -__directory $sshpath \ - --owner $dstuser \ - --group $dstgroup \ - --mode 700 -# the file authorized_keys depends on the .ssh folder -require="__directory${sshpath}" \ - __file "$sshpath/authorized_keys" \ - --mode 640 \ - --owner $dstuser \ - --group $dstgroup -# the line added depends on authorized_keys existence -require="__file${sshpath}/authorized_keys" __addifnosuchline sshkey --file \ - "$sshpath/authorized_keys" --line "$rsa" diff --git a/cdist/conf/type/__ssh_authorized_key/parameter/optional b/cdist/conf/type/__ssh_authorized_key/parameter/optional deleted file mode 100644 index 4903f5be..00000000 --- a/cdist/conf/type/__ssh_authorized_key/parameter/optional +++ /dev/null @@ -1,2 +0,0 @@ -srcuser -dstuser