Question

como deshabilitar la sshkey de mi droplet

como hago para deshabilitar la sshkey de mi droplet?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

alexdo
Site Moderator
Site Moderator badge
December 19, 2022

Hello @victordiaz

In order to ensure that you’ll still have access to your droplet when PubkeyAuthentication is disabled you’ll need to enable Password level authentication, you can follow these steps.

Edit the sshd config file

  1. sudo nano /etc/ssh/sshd_config
  1. Change PasswordAuthentication from “no” to “yes” and save the file
  2. Change PubkeyAuthentication from yes to no.
  3. Restart the ssh service:
  1. sudo systemctl restart sshd

Happy Holidays!

KFSys
Site Moderator
Site Moderator badge
December 18, 2022

Hi @victordiaz,

You can disable your SSH authentication by editing the /etc/ssh/sshd_confg file on your Droplet.

In there you can find the line that says PubkeyAuthentication Yes and change it to PubkeyAuthentication No.

Afterward restart the SSHD service and you are good to go:

service sshd restart

If you however want to disable only a particular SSH key from accessing your Droplet, open the ~/.ssh/authorised_keys. Delete the line containing the key you wish to remove and that’s it.

Hola @victordiaz!!

Si tu Droplet está corriendo un Ubuntu, generalmente con PubkeyAuthentication especificas que la clave pública está permitida para la autenticación. Por defecto la tenemos en yes.

Puedes cambiar esta configuración modificando el archivo de configuración de tu Servidor SSH.

  1. sudo nano /etc/ssh/sshd_config

Luego busca PubKeyAuthentication y lo pones en no.

Finalmente solo necesitas reiniciar el servidor SSH, puedes hacerlo con el siguiente comando:

  1. sudo systemctl restart sshd

Ya me dices si te ha funcionado :)

Salu2,

Sergio Turpín

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel