linuxubuntusshssh-keygen

SSH still asking for password despite conf and permissions set up


I have a remote server (Contabo), and a Host (my Dell computer). I have created a new sudo user laura instead of using root all the time, with:

adduser laura
usermod -aG sudo laura

I have generated SSH keys on my Dell computer with the following command:

ssh-keygen -t rsa -b 4096

The ssh-copy-id did not work, however I've used this command to send the public key newly generated, into my Contabo Server:

sudo scp id_rsa_contabo.pub laura@:/home/laura/.ssh/

Of course I have replaced with the IP of my Contabo server. I can see the public key inside my .ssh folder, which I insert into an authorized_keys file.

However, no matter what I do (and I've been trying for hours now), when I do this:

ssh laura@<IP>

With < IP > replaced by the IP address of my Contabo server, the system still asks me for a password!

What I've tried so far:

This is because my file does not match the default naming convention for keys (normally it’s id_rsa).

No error message, however my file id_rsa_contabo (the one in the authorized_keys) is not even read by the system. See my screenshot for the output of this command:

screenshotssh

.

Nothing seems to work. Please can a good samaritan help me? :(


Solution

  • It works now (after I came in the office the next day). I believe I forgot to restart the services with the following command...

    systemctls restart ...