4

I can log into all Ubuntu instances with gcp using the same SSH keys, except for one instance, with the Admin creating a user for me, adding me to the sudo and admin groups, adding my pub key there as well, but I still cannot log in via ssh myname@ip, nor via the gcp SSH command, with the error message always being Permission denied (publickey).

  • I compared debug info of ssh -vvvv myname@IP with logs from other instances I can access, finding the difference at line 97:
    • IP I cannot log into: debug3: receive packet: type 51
    • IP I can log into: receive packet: type 60
     73 debug1: rekey in after 134217728 blocks
     74 debug1: Will attempt key: /Users/myname/.ssh/id_rsa RSA SHA256:gbz... explicit agent
     75 debug1: Will attempt key: myname@myname RSA SHA256:ge3... agent
     76 debug1: Will attempt key: myname@myname RSA SHA256:Ckn... agent
     77 debug2: pubkey_prepare: done
     78 debug3: send packet: type 5
     79 debug3: receive packet: type 7
     80 debug1: SSH2_MSG_EXT_INFO received
     81 debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
     82 debug3: receive packet: type 6
     83 debug2: service_accept: ssh-userauth
     84 debug1: SSH2_MSG_SERVICE_ACCEPT received
     85 debug3: send packet: type 50
     86 debug3: receive packet: type 51
     87 debug1: Authentications that can continue: publickey
     88 debug3: start over, passed a different list publickey
     89 debug3: preferred publickey,keyboard-interactive,password
     90 debug3: authmethod_lookup publickey
     91 debug3: remaining preferred: keyboard-interactive,password
     92 debug3: authmethod_is_enabled publickey
     93 debug1: Next authentication method: publickey
     94 debug1: Offering public key: /Users/myname/.ssh/id_rsa RSA SHA256:gbz... explicit agent
     95 debug3: send packet: type 50
     96 debug2: we sent a publickey packet, wait for reply
    
     97 debug3: receive packet: type 51
    
     98 debug1: Authentications that can continue: publickey
     99 debug1: Offering public key: myname@myname RSA SHA256:ge3... agent
    100 debug3: send packet: type 50
    101 debug2: we sent a publickey packet, wait for reply
    102 debug3: receive packet: type 51
    103 debug1: Authentications that can continue: publickey
    104 debug1: Offering public key: myname@myname RSA SHA256:Ckn... agent
    105 debug3: send packet: type 50
    106 debug2: we sent a publickey packet, wait for reply
    107 debug3: receive packet: type 51
    108 debug1: Authentications that can continue: publickey
    109 debug2: we did not send a packet, disable method
    110 debug1: No more authentication methods to try.
    
    111         myname@myname@ip: Permission denied (publickey).
    


Does anybody know why I cannot log into the IP due to type 51, and should I re-create id_rsa key-pair; if so, will I be able to log into other instances, as other instances are using my current id_rsa key without any issue and I am unsure if re-creating it will create a new issue?

  • I have three pairs of keys within my local machine's ~/.ssh [id_rsa, google_compute_engine, google_compute_engine2] and for debugging purposes, I asked the Admin to add all the pub keys to that instance (even if id_rsa has a problem, the other two should have been workable, and am unsure why none work)
1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.