Ambos lados, revisión anterior
Revisión previa
Próxima revisión
|
Revisión previa
Última revisión
Ambos lados, revisión siguiente
|
es:howtos:security:sshkeys [2019/06/15 01:51 (UTC)] antares_alf |
es:howtos:security:sshkeys [2021/09/12 08:28 (UTC)] antares_alf [Configure su clave pública en la computadora remota] |
| |
El concepto de claves públicas/privadas puede ser difícil de explicar, trataremos de hacerlo de la manera más simple posible. | El concepto de claves públicas/privadas puede ser difícil de explicar, trataremos de hacerlo de la manera más simple posible. |
| |
<note>Permítanme decir esto de nuevo, para todos ustedes, crypto nerds allí afuera: Sí, ya sé que esta es una versión muy simplificada de SSH. Esto se crea para todos los novatos SSH... mmmmkay?</note> | <note>Permítanme decir esto de nuevo, para todos ustedes, crypto nerds allí afuera: Sí, ya sé que esta es una versión muy simplificada de SSH. Esto se crea para todos los novatos SSH... mmmmkay?</note> |
| |
| |
| |
===== Create the public/private key pair ===== | ===== Crear el par de claves pública/privada ===== |
| |
| Para crear una clave pública y una privada, use la utilidad OpenSSH ''ssh-keygen''. Esto generará automáticamente un par de claves, utilizando los valores predeterminados. Aquí hay un pequeño ejemplo: |
To create a public and a private key, use the OpenSSH ''ssh-keygen'' utility. This will automatically generate a key pair, using the default values. Here is a small example: | |
| |
<code> | <code> |
</code> | </code> |
| |
OK, what is going on here? | OK, ¿qué está pasando aquí? |
First, ''ssh-keygen'' is going to generate a key pair. So far, so good, please make sure you read the [[http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen&apropos=0&sektion=1&manpath=OpenBSD+5.1&arch=i386&format=html|ssh-keygen man page]] to understand all the options, and there are many of them. | Primero, ''ssh-keygen'' generará un par de claves. Hasta ahora, todo bien, asegúrese de leer el |
| [[http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen&apropos=0&sektion=1&manpath=OpenBSD+5.1&arch=i386&format=html|ssh-keygen man page]] entender todas las opciones, y hay muchas de ellas. |
| |
Next, ''ssh-keygen'' is going to respond that it is creating the RSA key pair (public and private key). RSA is the name of the encryption algorithm used. There are three such encryption possible: DSA, RSA and ECDSA. Which one is the best is left as an exercice for the reader... ;-) | A continuación, ''ssh-keygen'' responderá que está creando el par de claves RSA (clave pública y privada). RSA es el nombre del algoritmo de cifrado utilizado. Hay tres tipos de cifrado posibles: DSA, RSA y ECDSA. Cuál es el mejor se deja como ejercicio para el lector ... ;-) |
| |
It is then going to ask you where to save the key. Here, ''TEST.rsa'' is entered, since there are other keys on the system. Giving a proper name to the key is important, since it makes it much easier to remember which key connects to what. | Luego le preguntará dónde guardar la clave. Aquí se ingresa ''TEST.rsa'', ya que hay otras claves en el sistema. Es importante dar un nombre propio a la clave, ya que hace que sea mucho más fácil recordar a qué se conecta cada clave. |
| |
For instance, if you had an account on a machine named: ''stang.slackware.com'', a good name for the key pair would be ''stang_slackware_com.rsa'' or some such. | Por ejemplo, si tuviera una cuenta en una máquina llamada: ''stang.slackware.com'', un buen nombre para el par de claves sería ''stang_slackware_com.rsa'' o algo así. |
| |
Next, ''ssh-keygen'' asks you for a passphrase. It is always a good idea to enter a passphrase! This allows you to protect your private key, even if it falls into the wrong hands. If you are absolutely, 100% sure that your private key is **not** going to fall into the wrong hands (how optimistic you are!), just press ''Enter'' here. | A continuación, ''ssh-keygen'' le pide una frase de contraseña. ¡Siempre es una buena idea ingresar una frase de contraseña! Esto le permite proteger su clave privada, incluso si cae en las manos equivocadas. Si está absolutamente seguro al 100% de que su clave privada **no** va a caer en las manos equivocadas (¡qué optimista es!), Simplemente presione ''Entrar'' aquí. |
| |
The rest are just informative messages, and you will note that the key pair has been saved as follows: | |
| |
- The private key is named ''TEST.rsa''. | El resto son solo mensajes informativos, y notará que el par de claves se ha guardado de la siguiente manera: |
- The public key - the one you want to copy on the remote machine - is named ''TEST.rsa.pub'' | |
| |
Congratulations! You are halfway there! | - La clave privada se llama ''TEST.rsa''. |
| - La clave pública, la que desea copiar en la máquina remota, se llama ''TEST.rsa.pub'' |
| |
===== Configure your public key on the remote computer ===== | ¡Felicidades! Estás a medio camino! |
| |
| ===== Configure su clave pública en la computadora remota ===== |
| |
All right, now, how to use the public/private key? That's simple enough: copy the public key (named ''TEST.rsa.pub'' as we have seen) onto the remote computer. The best way to do this is to use ''scp'' the OpenSSH secure copy program. For instance: | Muy bien, ahora, ¿cómo usar la clave pública/privada? Eso es bastante simple: copie la clave pública (llamada ''TEST.rsa.pub'' como hemos visto) en la computadora remota. La mejor manera de hacer esto es usar ''scp'' el programa de copia segura OpenSSH. Por ejemplo: |
| |
<code> | <code> |
</code> | </code> |
| |
In the example above, I copy the //__public__// key ''TEST.rsa.pub'' on the remote machine named ''test.example.com'', as user ''nr''. The file is renamed ''authorized_keys'' which is the name of the file that contains all the public keys authorized to connect to the server. | En el ejemplo anterior, copió la //clave pública// ''TEST.rsa.pub'' en la máquina remota llamada ''test.example.com'', como usuario ''nr''. El archivo cambia de nombre a ''authorized_keys'', que es el nombre del archivo que contiene todas las claves públicas autorizadas para conectarse al servidor. |
| |
<note warning>A word of caution here: do not execute the ''scp'' command above if you already have an ''authorized_keys'' file on the remote computer! This will replace the content of the file with your public key!! | <note warning>**Una advertencia**: ¡no ejecute el comando ''scp'' anterior si ya tiene un archivo de ''authorized_keys'' en la computadora remota! ¡¡Esto reemplazará el contenido del archivo con su clave pública!! |
If you already have an ''authorized_keys'' file, execute a ''cat TEST.rsa.pub >> authorized_keys'' on the remote machine to add your public key at the end of authorized keys.</note> | Si ya tiene un archivo ''authorized_keys'', ejecute un ''cat TEST.rsa.pub >> authorized_keys'' en la máquina remota para agregar su clave pública al final de las claves autorizadas. |
| </note> |
| |
Since all the SSH keys you use should be placed in the ''.ssh'' directory, that's where it goes on the remote machine. | Dado que todas las claves SSH que usa deben colocarse en el directorio ''.ssh'', ahí es donde va en la máquina remota. |
| |
So, are we done? Not really, there is just one small thing to do, but it is truly important, since it is the source of a lot of problems... | |
| |
| Entonces, ¿hemos terminado? Realmente no, solo hay una pequeña cosa por hacer, pero es realmente importante, ya que es la fuente de muchos problemas... |
===== Check the public key permissions on the remote machine ===== | ===== Check the public key permissions on the remote machine ===== |
| |
<!-- * Original source: [[http://some.website.org/some/page.html]] --> | <!-- * Original source: [[http://some.website.org/some/page.html]] --> |
<!-- Authors are allowed to give credit to themselves! --> | <!-- Authors are allowed to give credit to themselves! --> |
* Originally written by [[wiki:user:Noryungi |Noryungi]] | * Originalmente redactado por [[wiki:user:Noryungi |Noryungi]] |
<!-- * Contrbutions by [[wiki:user:yyy | User Y]] --> | <!-- * Contrbutions by [[wiki:user:yyy | User Y]] --> |
| * Traducción al Español [[wiki:user:antares_alf | antares_alf]] \\ |
<!-- Please do not modify anything below, except adding new tags.--> | <!-- Please do not modify anything below, except adding new tags.--> |
<!-- You must also remove the tag-word "template" below. Otherwise your page will not show up in the Table of Contents --> | <!-- You must also remove the tag-word "template" below. Otherwise your page will not show up in the Table of Contents --> |
{{tag>howtos security ssh sshkeys author_noryungi}} | {{tag>howtos security ssh sshkeys author_noryungi}} |