Für alle die noch Keys ändern müssen und eine Authentifizierung ohne Passwort haben (Backupscripts, Nagios usw.), hier ein kleines Shell Script was die Arbeit etwas abnimmt
Code:
#!/bin/sh
echo
echo This script will help you setup ssh public key authentication.
host=dummy
while [ -n "$host" ]; do
echo -n "SSH server: "
read host
if [ -n "$host" ]; then
echo -n "user[$USER]: "
read usr
if [ -z "$usr" ]; then
usr=$USER
fi
echo "Setting up RSA authentication for ${usr}@${host}..."
if [ -f ~/.ssh/id_rsa.pub ]; then
echo "RSA public key OK."
else
ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ""
fi
scp -P2222 ~/.ssh/id_rsa.pub ${usr}@${host}:~/
ssh ${usr}@${host} -p2222 "if [ ! -d ~/.ssh ]; then
mkdir ~/.ssh
fi
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 0600 ~/.ssh/authorized_keys
rm ~/id_rsa.pub"
echo
echo "You should see the following message without being prompted for anything now..."
echo
ssh ${usr}@${host} "echo !!! Congratulations, you are now logged in as ${usr}@${host} !!!"
echo
echo "If you were prompted, public key authentication could not be configured..."
echo
echo "Enter a blank servername when done."
echo
fi
done
echo "End of configuration."
!!! WICHTIG !!!
Der SSH Befehl greift bei mir auf Port "2222" zu.
Bitte entsprechend abändern oder ganz weglassen.
Greez BeNe