Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 am totally new to this. Please bear with me if my question is totally nuts. I am trying to setup rsa keys between two servers. I tried the following steps.

ssh-keygen -t rsa

copied the as authorized_keys in the remote servers /.ssh/ folder

sftp is still asking for a password.

tried sftp -e also. and tried changing authorized_keys to authorized_key2 in remote. Nothing is working

One thing that bothers me is ssh -V returns SSH protocols 1.5/2.0 in my server and SFTP version is SFTP protocol version 3 in the remote server. I am not sure whether this is the problem.

Can anyone please suggest? Really appreciate your help.


share|improve this question

migrated from Nov 9 '12 at 19:55

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

Try to determine which protocol is actually used between ssh-client and ssh-server (e.g. removing the entry from host's .ssh/known_hosts and connecting again) - is RSA used at all? Maybe, ECDSA or DSA is used. – EarlGray Nov 9 '12 at 11:57
Thanks for the reply EarlGray. I removed the known_hosts and when i tried connecting i am able to see "DSA key fingerprint is....". Does this mean i have to use DSA? – slgp Nov 9 '12 at 12:17
i did try ssh-keygen -t dsa after that and try posting the as authorized_keys. Still not working. It still prompts for the password. Any suggestions? – slgp Nov 9 '12 at 12:18

Does your look like this?:

-----END PUBLIC KEY-----

If so then you're authorized_keys thing needs to look more like this:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUpwmJG8wVQZKjeGcjDOL5UlsuusFncCzWBQ7RKNUSesmQRMSGkVb1/3j+skZ6UtW+5u09lHNsj6tQ51s1SPrCBkedbNf0Tp0GbMJDyR4e9T04ZZw== phpseclib-generated-key

Also, fyi, the SFTP vs. SSH version really doesn't matter that much. SFTP has versions 0 - 6. SSH has 1-2. SFTP (any version) only works on SSHv2.

share|improve this answer

You must log in to answer this question.