informatica:linux:ssh:login_intercambio_claves
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
informatica:linux:ssh:login_intercambio_claves [2012/11/02 09:16] – javi | informatica:linux:ssh:login_intercambio_claves [2015/04/13 20:19] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Login por SSH por intercambio de claves | + | ===== Login por SSH por intercambio de claves ===== |
ssh keys exchange | ssh keys exchange | ||
- | **ARTICULO A MEDIAS** | + | Quiero iniciar sesion desde ' |
- | + | ||
- | Me quiero logar en la máquina | + | |
^ Maquina ^ Usuario ^ | ^ Maquina ^ Usuario ^ | ||
- | | maquina1 | usuario1 | + | | maquina1 | usuario |
- | | maquina2 | usuario2 | + | | maquina2 | usuario |
+ | |||
+ | ==== Recomendada ==== | ||
+ | |||
+ | 1. (maquina1) Creamos las claves para el usuario ' | ||
+ | |||
+ | ssh-keygen -t rsa | ||
+ | |||
+ | Pulsamos ' | ||
+ | |||
+ | < | ||
+ | Generating public/ | ||
+ | Enter file in which to save the key (/ | ||
+ | Enter passphrase (empty for no passphrase): | ||
+ | Enter same passphrase again: | ||
+ | Your identification has been saved in / | ||
+ | Your public key has been saved in / | ||
+ | The key fingerprint is: | ||
+ | 3c: | ||
+ | The key's randomart image is: | ||
+ | +--[ RSA 1024]----+ | ||
+ | | . + | | ||
+ | | o + o | | ||
+ | | o * o | | ||
+ | | = X + | | ||
+ | | . E O | | ||
+ | | . = o | | ||
+ | | . o | | ||
+ | | o . | | ||
+ | | . | | ||
+ | +-----------------+ | ||
+ | </ | ||
+ | |||
+ | Habremos generado el siguiente archivo: | ||
+ | |||
+ | / | ||
+ | |||
+ | 2. (maquina1) Copiamos el archivo generado en el paso anterio a ' | ||
+ | |||
+ | ssh-copy-id usuario@maquina2 | ||
+ | |||
+ | ==== A mano ==== | ||
+ | |||
+ | 1. (maquina1) Creamos las claves para el usuario ' | ||
+ | |||
+ | ssh-keygen -t rsa | ||
+ | |||
+ | Pulsamos ' | ||
+ | |||
+ | < | ||
+ | Generating public/ | ||
+ | Enter file in which to save the key (/ | ||
+ | Enter passphrase (empty for no passphrase): | ||
+ | Enter same passphrase again: | ||
+ | Your identification has been saved in / | ||
+ | Your public key has been saved in / | ||
+ | The key fingerprint is: | ||
+ | 3c: | ||
+ | The key's randomart image is: | ||
+ | +--[ RSA 1024]----+ | ||
+ | | . + | | ||
+ | | o + o | | ||
+ | | o * o | | ||
+ | | = X + | | ||
+ | | . E O | | ||
+ | | . = o | | ||
+ | | . o | | ||
+ | | o . | | ||
+ | | . | | ||
+ | +-----------------+ | ||
+ | </ | ||
+ | |||
+ | Habremos generado el siguiente archivo: | ||
- | 1. (maquina1) Creamos las claves para el usuario | + | /home/usuario/.ssh/id_rsa.pub |
- | # ssh-keygen -t dsa | + | |
- | Generating public/ | + | 2. (maquina1) Copiamos el archivo generado en el paso anterio a 'maquina2': |
- | Enter file in which to save the key (/ | + | |
- | Enter passphrase (empty for no passphrase): | + | |
- | Enter same passphrase again: | + | |
- | Your identification has been saved in / | + | |
- | Your public key has been saved in / | + | |
- | The key fingerprint is: | + | |
- | e7: | + | |
- | The key's randomart image is: | + | |
- | +--[ DSA 1024]----+ | + | |
- | | | | + | |
- | | | | + | |
- | | | | + | |
- | | . o | | + | |
- | | . +. S + o | | + | |
- | | o. =.Eo = . . | | + | |
- | |. +o... + . . | | + | |
- | |.o +.. . | + | |
- | |o...o . | + | |
- | +-----------------+ | + | |
- | 2. Copiamos la clave dentro del siguiente fichero con permisos 644 | + | scp /home/usuario/.ssh/id_rsa.pub test-6.dev:/ |
- | | + | |
- | Podemos subirla al servidor, | + | 3. (maquina2) Creamos si no lo estan directorios |
- | #scp -P 443 id_dsa.pub usuario1@maquina1.mine.nu:/tmp/ | + | |
- | #ssh usuario1@maquina1.mine.nu | + | |
- | #cat / | + | |
- | Y ahora lo hacemos al revés | + | < |
+ | [[ ! .ssh ]]; mkdir .ssh | ||
+ | [[ ! .ssh/ | ||
+ | chmod 600 .ssh/ | ||
+ | cat / | ||
+ | </ | ||
+ | 4. (maquina1) Deberiamos ser capaces de iniciar una session SSH desde ' | ||
+ | ssh maquina2 |
informatica/linux/ssh/login_intercambio_claves.1351847794.txt.gz · Last modified: 2015/04/13 20:19 (external edit)