0

Hi everyone, I haven a new Linux server but when I want to connect with SSH, I can only use my id_rsa.pub key. I tried making other .pub keys (instead of the id_rsa.pub) but it keeps asking a password when I want to use other keys. Am I missing something here?

I have tried: Editing the permission of my .ssh folder because it seems like a common problem, but it was already set to the correct permission.

Here is the code to make a key and copy it to my server:

ssh-keygen -t rsa -C "[email protected]" ssh-copy-id -i ~/.ssh/test.pub user@myLinuxServer 

I can find the key on my server in the authorized_keys file so I think copying is not a problem.

I expect: that I can login without giving a password when I type:

 Ssh user@host 

in the terminal, but it still asks for a password. Only when I use ssh-copy-id on the id_rsa.pub key, it will work.

3
  • You can use ssh -vv user@host to see in more deail the login process, when is tried and what is not. Commented May 27, 2019 at 23:20
  • look at your ~/.ssh/config for that host Commented May 27, 2019 at 23:50
  • @linuxdev2013 I don't have ~/.ssh/config file.. only known_hosts but is the same innit? Commented May 28, 2019 at 19:35

1 Answer 1

1

You have to copy you public key into ~/.ssh/authorized_keys file.

AFAIK authorized_key is not a directory.

You can read this article

3
  • My bad, I meant authorized_keys file, not folder ... :) Commented May 28, 2019 at 19:30
  • @aaronlejeune is your problem solved? Commented May 30, 2019 at 10:30
  • yes it worked, sorry for the late answer Commented Jan 7, 2020 at 11:40

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.