I have Linux VM on Azure which at first set without SSH keys. which means authentication is made only with password via SSH. I would like to change it now. I tried the way I know, I can login with the keys - but still login with password.
What else did I miss? There is something else?
Thanks
Tried to configure SSH key, disable the 'passwordauthentication'
Change ssh config Add key via azure portal
Try to following these steps -
Login to your existing azure VM using passwords authentication.
Create new ssh key pair.
ssh-keygen -t rsa -b 2048
Replace
~/.ssh/authorized_keys
with~/.ssh/id_rsa.pub
keymv ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
Save
~/.ssh/id_rsa
public key to your local system.Edit
/etc/ssh/sshd_config
and make following changesChange PasswordAuthentication to this:
PasswordAuthentication no
Change PubkeyAuthentication to this:
PubkeyAuthentication yes
Change PermitRootLogin to this:
PermitRootLogin no
Change ChallengeResponseAuthentication to this:
ChallengeResponseAuthentication no
Restart the vm using following command
sudo systemctl restart ssh