Pergunta

I run into this trouble after I ran chown on the home folder of my ec2 instance, when I use sshfs to mount it on my local directory.
I make a mistake here. And after this, I could no longer login to it via ssh. Any way to fix this.

the logs are:

OpenSSH_6.0p1 Debian-3, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /home/me/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to ec2-54-219-20-60.us-west-1.compute.amazonaws.com [54.219.20.60] port 22.
debug1: Connection established.
debug1: identity file /home/me/ec2_key.pem type -1
debug1: identity file /home/me/ec2_key.pem-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH_5*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 4e:13:41:26:f5:9e:10:6d:c5:a7:65:cb:21:3c:de:f8
debug1: Host 'ec2-54-219-20-60.us-west-1.compute.amazonaws.com' is known and matches the ECDSA host key.
debug1: Found key in /home/me/.ssh/known_hosts:44
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/me/ec2_key.pem
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey)

Foi útil?

Solução

I've found my answer from the AWS guys at AWS Developer Forum. It works great.

The basic steps are:

  1. Stop the instance
  2. Detach the Root Volume
  3. Launch another instance(or if you have one already you can skip this step)
  4. Attached the Volume in 2 to the new(or already existing other) instance
  5. Log in into the instance
  6. Mount the Volume
  7. Change the folder permissions as appropriate
  8. Umount the Volume and detach it
  9. Attach it back to the original instace
  10. Start the instance and connect
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top