[Cialug] SSH says: Permission denied (publickey).
Scott Yates
Scott at yatesframe.com
Wed Nov 7 15:08:55 UTC 2018
I thought you needed your public key stored in the ~/.ssh folder in order
to use private key authentication. You might try ssh-copy-id to get your
keys set up properly.
On Wed, Nov 7, 2018 at 8:56 AM Todd Walton <tdwalton at gmail.com> wrote:
> I have a couple of servers on AWS. I wanted to move one to a different
> subnet in the same VPC, so I stopped the server, created an image from
> it, then using that image launched a new server in a new subnet. The
> resulting server is the same as it was, but with a new IP address.
>
> However, I can't ssh to it. I can do 'ssh todd at old_ip' and it asks me
> for my password and logs me in. But when I 'ssh todd at new_ip' it says
> "Permission denied (publickey)".
>
> I was able to get into the new server / new ip by using the default
> user. So I looked at my user account on the old instance and the new
> instance. There's nothing different. My ~/.ssh directory is empty on
> both. /etc/ssh/sshd_config is exactly the same on both, right down to
> the md5sum. And I'm obviously using the same ssh client for both from
> my local workstation.
>
> Here's sshd_config on the server:
>
> Protocol 2
> SyslogFacility AUTHPRIV
> PermitRootLogin no
> RSAAuthentication yes
> PubkeyAuthentication yes
> AuthorizedKeysFile .ssh/authorized_keys
> PermitEmptyPasswords no
> PasswordAuthentication yes
> ChallengeResponseAuthentication no
> GSSAPICleanupCredentials yes
> UsePAM yes
> AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY
> LC_MESSAGES
> AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
> AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
> X11Forwarding no
> ClientAliveInterval 60
> UseDNS no
> Banner /etc/ssh/banner
> Subsystem sftp /usr/libexec/openssh/sftp-server
>
> Anyone have a guess as to what's happening?
>
> --
> Todd
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>
More information about the Cialug
mailing list