Current time: 05-18-2024, 08:41 PM Hello There, Guest! (LoginRegister)


Post Reply 
Wichtig: OpenSSL Schlüssel in Debian unsicher
Author Message
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #16
RE: Wichtig: OpenSSL Schlüssel in Debian unsicher
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 Wink

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
05-21-2008 09:30 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Wichtig: OpenSSL Schlüssel in Debian unsicher - BeNe - 05-21-2008 09:30 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)