DEV Community

Cover image for Como conectarse por SSH a un servidor Linux sin tener que escribir la clave cada vez
Diego
Diego

Posted on

1

Como conectarse por SSH a un servidor Linux sin tener que escribir la clave cada vez

En este artículo voy a describir un método muy sencillo pero a la vez muy eficiente a la hora de ahorrarnos tiempo buscando, tecleando, copiando y pegando claves para conectarnos a nuestros servidores SSH.

Si las respuestas a estas preguntas:

  • ¿Cuantas veces te conectas a los mismos servidores por SSH?
  • ¿Cuantas veces tienes que escribir la clave?

Son de muchas para arriba, pues aquí tienes el truco.

Lo primero es asegurarnos que tenemos creada una clave ssh. Con lo que lanzamos este comando:

❯ ssh-keygen
Enter fullscreen mode Exit fullscreen mode

Y una vez se haya generado nuestra clave, lanzamos este comando, poniendo la IP del servidor al que queremos conectarnos y el usuario con el que realizamos la conexión. Nos pedirá una vez la clave, y ¡listo! ya nunca más tendremos que ponerla:

❯ ssh-copy-id -i ~/.ssh/id_rsa root@192.168.1.200
Enter fullscreen mode Exit fullscreen mode

Evidentemente, root tenéis que cambiarlo por vuestro usuario y 192.168.1.200 tenéis que cambiarlo por la IP del servidor al que os conectáis.

¡Un abrazo para todos y todas!

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay