Star Hype News.

Premium celebrity moments with standout appeal.

updates

how to turn off password-less login for ssh?

By Matthew Cannon

I had setup password-less SSH login from my desktop to my laptop following the steps here. Now I want to turn off the password-less login so that when I ssh from my desktop to my laptop, it will ask for the password. How do I do it?

2 Answers

Disable pubkey authentication on the client where you don't want to use it.

ssh -o PubkeyAuthentication=no your_host

or in your ~/.ssh/config:

Host your_host PubkeyAuthentication no

If you want to remove the public key from the server, you need to remove the appropriate line from ~/.ssh/authorized_keys on server.

2

As

ssh -o PubkeyAuthentication=no your_host

can easily be reverted by anyone who has access to the client to login to your laptob without needing a password at all, it may be a better choice to use a password encrypted private-key for those destinations, where you want to be asked for a password before login.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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