1

I changed the password for a user, but if someone still has the SSH key on their laptop the user can still login right?

The password is only used if you don't have a SSH key right?

1

Yes, the user still is able to login only using the keys.

If you setup a SSH key for one of your clients then the preferred options for that client is to use SSH key unless he specifically uses the password authentication method like:

ssh -o PreferredAuthentications=password  host

then he should know the password. If you are looking for a way so no one can login to this account you have to remove the keys:

mv /home/user/.ssh/authorized_keys{,.rm}

then peoply only can login using password, but they still are able to copy their keys to ~/.ssh.

for more flexible rules you have to changes your ssh server configs.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.