Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I connect to my webserver with Putty through SSH + password and wanted to generate a pair of keys to do the login for me. Unfortunately, the command gets somehow 'stuck'.. as you can see on the screenshot

enter image description here

Why is this happening?

share|improve this question

migrated from stackoverflow.com Jan 10 '13 at 13:39

This question came from our site for professional and enthusiast programmers.

    
You pressed enter, right? :/ –  jgr Jan 10 '13 at 13:09
    
Yes, of course :D and then i keep waiting and waiting... Why do i get a down vote? –  user1351482 Jan 10 '13 at 13:15
    
Please do not post screenshots of text. Just post the text here in the question. –  larsks Jan 10 '13 at 13:43

2 Answers 2

This is a script I use to generate SSH keys. Give it a try.

#!/bin/sh

KEY="$HOME/.ssh/id_dsa.pub"

if [ ! -f ~/.ssh/id_dsa.pub ];then
  ssh-keygen -t dsa -b 1024 -f ~/.ssh/id_dsa -N ''
fi

if [ -z $1 ];then
    echo " "
    echo "Usage: $0 {user@remote.host}"
    echo "  "
    echo "  The 'user' is the remote user account allowed to authenticate to"
    echo "  the 'remote.host'."
    echo "  "
    echo "  This ssh connection is used once to copy your key to the 'remote.host'"
    echo "  "
    exit
fi

echo "Sending your key to $1... "

KEYCODE=`cat $KEY`
ssh -q $1 "mkdir ~/.ssh 2>/dev/null; chmod 700 ~/.ssh; echo "$KEYCODE" >> ~/.ssh/authorized_keys; chmod 644 ~/.ssh/authorized_keys"

echo "done!"
share|improve this answer

It looks like you are first connecting to the remote server and then generating keys. Don't do that! Your private key should never leave your local system. You should generate your keys locally using, e.g., puttygen, and then put the generated public key into your authorized_keys file on the remote host.

share|improve this answer
    
+1. just use the tools that come with putty to set up keys for pubkey auth. –  Rob Jan 10 '13 at 15:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.