He creado una instancia de Ubuntu 12.04 en Amazon EC2.Intentando usar claves RSA para SSH en EC2, obteniendo: identificador RSA1 incorrecto ... permiso denegado (clave pública)
He descargado el archivo PEM y puedo SSH en la instancia, no hay problema.
Ahora, quiero crear algunas cuentas en la instancia remota para consultores, etc. Deben poder ingresar al cuadro usando las teclas RSA. En la máquina EC2, he configurado algunas cuentas en ~/home/y las he asignado al administrador del grupo. También me he dado una cuenta similar (MyTestAccount) para probar. Esto es lo que hice:
que utiliza la tecla generación para crear las claves públicas y privadas en el directorio .ssh en mi máquina local (~/.ssh):
drwx------ 2 peter peter 1024 Sep 14 10:23 .ssh
Y los archivos dentro:
-rw------- 1 peter peter 1675 Sep 14 10:23 id_rsa
-rw------- 1 peter peter 394 Sep 14 10:23 id_rsa.pub
-rw------- 1 peter peter 444 Sep 14 00:05 known_hosts
entonces SCP'd el archivo id_rsa.pub a mi instancia EC2 remoto y adjunta al archivo .ssh/authorized_keys en mi instancia remota. Los permisos de mi directorio .ssh remota:
drwx------ 2 ubuntu ubuntu 4096 Sep 16 16:13 .ssh
Y de mis authorized_keys del archivo:
-rw------- 1 peter ubuntu 1179 Sep 14 00:05 authorized_keys
A continuación, cierra la sesión de mi instancia remota y trató de SSH a la caja de control remoto usando las nuevas claves . Cuando emito el siguiente comando:
[email protected]:~/.ssh$ ssh -vvv [email protected]
obtengo lo siguiente. Parece que hay algo mal con mi clave privada? ¿Alguna sugerencia? Gracias.
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: need priv 0
debug1: Connecting to ec2-XX-XXX-XX-XXX.compute-1.amazonaws.com [XX.XXX.XX.XXX] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/peter/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/peter/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/peter/.ssh/id_rsa-cert type -1
debug1: identity file /home/peter/.ssh/id_dsa type -1
debug1: identity file /home/peter/.ssh/id_dsa-cert type -1
debug1: identity file /home/peter/.ssh/id_ecdsa type -1
debug1: identity file /home/peter/.ssh/id_ecdsa-cert type -1
[SNIP ...]
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/peter/.ssh/id_dsa
debug3: no such identity: /home/peter/.ssh/id_dsa
debug1: Trying private key: /home/peter/.ssh/id_ecdsa
debug3: no such identity: /home/peter/.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try. **Permission denied (publickey).**
¿Ha intentado establecer la conexión SSH con 'ssh -i/ruta/a/su/yourserver' clave? – j0nes