Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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

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

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



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

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

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

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

Your Answer


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.