You'll also want to set:

ChallengeResponseAuthentication no

in sshd_config, and made sure the permissions on .ssh and its contents are at 0 for group and other - they'll be ignored otherwise.  The best bet, if it still doesn't work, is to check your ssh logs (/var/log/messages or somewhere similar) for errors - ssh is pretty good at telling you why your setup isn't working correctly.

On Tue, Apr 13, 2010 at 2:26 PM, Keith Williams <Keith@keiths-place.co.uk> wrote:
I do apologise if this seems a stupid question.
 
I am struggling with this and probably missing something very basic. Have done the initials - changed password to strong random one. Set up iptables - all ports closed off except port 22 and 80. Fail2Ban running and configured, I will change ssh to another port later. Set up non-root user, let's call him fred - with again a strong password.
 
Checked sshd config file - using protocol 2. Used puttygen to generate keypair, private key secured with a near-gibberish longish passphrase, loaded private key into pageant. Saved public key to /home/fred/.ssh/authorised_keys then chmod that to 744 and .ssh directory (tried them also at 700 same effect). Changed PasswordAuthorisation in sshd config file to no
 
 
Fire up Putty set VPS ip goto to data page and put in fred for username then to ssh>auth page to set attempt using pageant and select the private key file to use. Press open and lo and behold, it asks me for password. I put that in and I am logged on. Why is it using passwords, why ignoring keys?
 
At my age you can't afford to lose too much hair, but I am pulling it out over this
 
Keith
--
Keith

The most dangerous strategy is to jump a chasm in two leaps.

www.westnorfolkrspca.org.uk

_______________________________________________
users mailing list
users@lists.bitfolk.com
https://lists.bitfolk.com/mailman/listinfo/users