From cafcd5d4368e57f162a641ed3f4835ecb5a6d391 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 28 Feb 2002 14:09:04 +0000 Subject: Initial revision --- mksshauth | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 mksshauth (limited to 'mksshauth') diff --git a/mksshauth b/mksshauth new file mode 100755 index 0000000..f6b688e --- /dev/null +++ b/mksshauth @@ -0,0 +1,23 @@ +#!/bin/bash + +ssh_version=$1 +host=$2 + +case "$ssh_version" in + 1) + [ -f ~/.ssh/identity.pub ] || ssh-keygen + ssh $host "mkdir -p ~/.ssh && echo `cat ~/.ssh/identity.pub` >> ~/.ssh/authorized_keys" + ;; + 2|dsa) + [ -f ~/.ssh/id_dsa.pub ] || ssh-keygen -t dsa + ssh $host "mkdir -p ~/.ssh && echo `cat ~/.ssh/id_dsa.pub` >> ~/.ssh/authorized_keys2" + ;; + rsa) + [ -f ~/.ssh/id_rsa.pub ] || ssh-keygen -t rsa + ssh $host "mkdir -p ~/.ssh && echo `cat ~/.ssh/id_rsa.pub` >> ~/.ssh/authorized_keys2" + ;; + *) + echo "Usage: $(basename $0) 1|2|dsa|rsa [user@]host" + exit 1 + ;; +esac -- cgit v1.2.3