Hi there, I am new to linux, having only started using it last week. I have some basic understanding of how it works from reading online tutorials and have managed to get quite a few things set up and working just how I want them but I am having trouble getting SSH to work without password authentication and instead using a key. I must have spent a good 4 hours now and each time I get the same reply that the 'server refused out key' and was hoping somebody here can help me.
There are a variety of tutorials to do this that I have seen but they all list slightly different or contradicting methods or have poor English and are hard to understand for a beginner and none so far have resulted in a successful authentication via the key.
So I will give some details and hope for a reply:
I am logging into the box via windows using putty and this program is pretty self explanatory for most of it, I have created a public and private key using the putty generator and made sure putty uses that key when connecting (for troubleshooting purposes I left the key password blank).
After this is where I get confused, the websites I visit all show different formatting for how I should paste this key into the authorized_keys file so my problem may lie here, some sites say to add bits to the end of the key, others say to delete bits, some say to make sure there is a blank space at the start and some don't. I also have conflicting advice on what permissions to set.
Finally I am also unsure of exactly where the authorized_keys file should go.
In the sshd_config file I have changed the default ssh port for security reasons and set rsaa and pubkey authentication to yes, the authorized keys file was default set to %h/.ssh/authorized_keys so I left it as this but the .ssh folder did not seem to exist on my system so I created it and placed the file in there however due to my inexperience I am not sure if I created it in the correct location, I assumed %h sets it to the /home directory so created the .ssh folder in /home by changing to the directory and doing mkdir .ssh and created the authorized_keys file there. Just to be sure I also created the exact same file and folder in /home/myusername/
This is about as far as I get and each time authentication always fails and it is about to make me give up if I can;t find a solution soon