0

I have a virtual server. Recently, I disabled PasswordAuthentication to make it more secure.

I had already created a key pair using Puttygen in Windows. I converted the private key (.ppk) using putty-tools in Linux so that I could use it in my Linux devices.

The problem is that I can't log in to my server from my Linux boxes. Windows works fine (I'm using Putty).

I thought of also converting the public key, but where do I put it in my server? There's already a public key on there, inside authorized_keys and it's the same public key I created at the beginning. Shouldn't it work regardless of the private key's format, especially since it's just a string of text pretty much?

P.S. I could re-enable password authentication, but I want to use ssh.

1 Answers1

0

Very likely that you have wrong permissions on your private key on the linux box. it should be 0600, like:

$ ls -l ~/.ssh/id_rsa
-rw-------. 1 me mygroup 1675 Mar 25 09:09 /home/me/.ssh/id_rsa
$    
kofemann
  • 4,626
  • 1
  • 25
  • 30
  • Yes It is 0600. – богдан Jul 25 '20 at 15:31
  • I was able to solve the problem by also converting the public key and putting it inside .ssh. I also change both keys' names to id_rsa and id_rsa.pub, respectively. (I don't know if that has anything to do with it.) – богдан Jul 25 '20 at 15:32
  • The `.pub` is useless on the client side and would not work at all if wrongly formatted server side. Changing the key names is more likely to have fixed it if you didn't provide the path to your key when attempting to connect (did you expect it to crawl your entire disk in search of SSH keys?). – Ginnungagap Jul 25 '20 at 23:52