GCE install asks for password

Hi,

After following the GCE cloud install instructions several times I’m unable to login to Clear Linux on GCE due to a ssh password request.

clear-gce

What am I missing? Is there a default password in addition to the SSH public key?

Seems different than the steps outlined in the guide.

Thank you,

Rana


Google* Compute Engine (GCE)
Version: 31990
Updated: Dec 27, 2019
Image for Google* Compute Engine

Did you set your SSH key to the Cloud console as documented in the last 3 bullets of step 13? the user name part of the key must exactly match your login name (i.e. ‘rana’).

2 Likes

Yes, I set my SSH key to the Cloud console as documented in the last 3 bullets of step 13.

image

The username in the SSH public key is the same username which i attempt to SSH into on the spun-up Clear Linux VM.

I have also tried various encryption types and bit lengths. Each time a password is requested. I have also tried ssh -i [PATH_TO_PRIVATE_KEY] [USERNAME]@[EXTERNAL_IP_ADDRESS].

It appears something has changed in GCE or the latest Clear Linux build for GCE since the guide was prepared?

Looking forward to using Clear Linux on GCE, if possible.

Thank you ttzeng.

@rana thanks for the heads up that Google has changed the interface of creating storage buckets, we will update the guide shortly. However, I just verified the instructions with the latest GCE image (clear-31990-gce.tar.gz), the guide still works for me.

Would you like to remove the current SSH key from the VM instance details page, and make sure you copy and paste the exactly public key in ~/.ssh/id_rsa.pub to your VM instance? Hope this helps.

2 Likes

Thank you Tony. Glad it’s working for you.

I’ve tried ~20 times, very carefully following the guide. Perplexing how I’m not able to log in. I tried from a different client computer as well.

Here is a verbose ssh log showing the host server rejecting the ssh negotiation.

Am somewhat of at a loss.

rana@aum~ $ ssh -vvv rana@35.192.158.64
OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019
debug1: Reading configuration data /home/rana/.ssh/config
debug2: resolve_canonicalize: hostname 35.192.158.64 is address
debug2: ssh_connect_direct
debug1: Connecting to 35.192.158.64 [35.192.158.64] port 22.
debug1: Connection established.
debug1: identity file /home/rana/.ssh/id_rsa type -1
debug1: identity file /home/rana/.ssh/id_rsa-cert type -1
debug1: identity file /home/rana/.ssh/id_dsa type -1
debug1: identity file /home/rana/.ssh/id_dsa-cert type -1
debug1: identity file /home/rana/.ssh/id_ecdsa type -1
debug1: identity file /home/rana/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/rana/.ssh/id_ed25519 type 3
debug1: identity file /home/rana/.ssh/id_ed25519-cert type -1
debug1: identity file /home/rana/.ssh/id_xmss type -1
debug1: identity file /home/rana/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.1
debug1: match: OpenSSH_8.1 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 35.192.158.64:22 as 'rana'
debug3: hostkeys_foreach: reading file "/home/rana/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/rana/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys from 35.192.158.64
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp521,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp521
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp521 SHA256:QkyDfUwsn/MCvkkHX//7dd/xELjxhO1kXeqehSAYwsY
debug3: hostkeys_foreach: reading file "/home/rana/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/rana/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys from 35.192.158.64
debug1: Host '35.192.158.64' is known and matches the ECDSA host key.
debug1: Found key in /home/rana/.ssh/known_hosts:2
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /home/rana/.ssh/id_ed25519 ED25519 SHA256:KkhHKSGJaXWJEHNHsZmiNdW6pKPbVcqtqrJA0ksLAfM agent
debug1: Will attempt key: /home/rana/.ssh/id_rsa 
debug1: Will attempt key: /home/rana/.ssh/id_dsa 
debug1: Will attempt key: /home/rana/.ssh/id_ecdsa 
debug1: Will attempt key: /home/rana/.ssh/id_xmss 
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
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>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/rana/.ssh/id_ed25519 ED25519 SHA256:KkhHKSGJaXWJEHNHsZmiNdW6pKPbVcqtqrJA0ksLAfM agent
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/rana/.ssh/id_rsa
debug3: no such identity: /home/rana/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /home/rana/.ssh/id_dsa
debug3: no such identity: /home/rana/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/rana/.ssh/id_ecdsa
debug3: no such identity: /home/rana/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/rana/.ssh/id_xmss
debug3: no such identity: /home/rana/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug3: send packet: type 50
debug2: we sent a keyboard-interactive packet, wait for reply
debug3: receive packet: type 60
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password: 

@rana, could you confirm you can access other VM instances (e.g. Ubuntu) on GCP using the same key? It looks like you provisioning the VM instance with the RSA public key, but from your ssh log, it looks like you don’t have the RSA private key /home/rana/.ssh/id_rsa, so that you got below messages: (though it seems you do have a ed25519 key)

debug1: identity file /home/rana/.ssh/id_rsa type -1
debug1: identity file /home/rana/.ssh/id_rsa-cert type -1
debug1: identity file /home/rana/.ssh/id_dsa type -1
debug1: identity file /home/rana/.ssh/id_dsa-cert type -1
debug1: identity file /home/rana/.ssh/id_ecdsa type -1
debug1: identity file /home/rana/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/rana/.ssh/id_ed25519 type 3
debug1: identity file /home/rana/.ssh/id_ed25519-cert type -1
debug1: identity file /home/rana/.ssh/id_xmss type -1
debug1: identity file /home/rana/.ssh/id_xmss-cert type -1
...
debug1: Will attempt key: /home/rana/.ssh/id_ed25519 ED25519 SHA256:KkhHKSGJaXWJEHNHsZmiNdW6pKPbVcqtqrJA0ksLAfM agent
debug1: Will attempt key: /home/rana/.ssh/id_rsa 
debug1: Will attempt key: /home/rana/.ssh/id_dsa 
debug1: Will attempt key: /home/rana/.ssh/id_ecdsa 
debug1: Will attempt key: /home/rana/.ssh/id_xmss
...
debug1: Offering public key: /home/rana/.ssh/id_ed25519 ED25519 SHA256:KkhHKSGJaXWJEHNHsZmiNdW6pKPbVcqtqrJA0ksLAfM agent
...
debug1: Trying private key: /home/rana/.ssh/id_rsa
debug3: no such identity: /home/rana/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /home/rana/.ssh/id_dsa
debug3: no such identity: /home/rana/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/rana/.ssh/id_ecdsa
debug3: no such identity: /home/rana/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/rana/.ssh/id_xmss
debug3: no such identity: /home/rana/.ssh/id_xmss: No such file or directory

I used to create my RSA key following this guide. You may try with RSA key mechanism instead of the ed25519 algorithm.

@rana, well, I reconfigured my ed25519 key to my Clear Linux based VM instance, I can still access to it. So, I think once you copy and paste your ed25519 public key ~/.ssh/id_ed25519.pub to your VM instance (instead of the RSA public key ~/.ssh/id_rsa.pub), you should be able to access to it.

Is this really the case? In other cloud providers, this isn’t used at all and the default user is clear.

Have you tried to ssh as clear@<ip address> instead, @rana ?

@ahkok Thanks for the tip. I tried clear@<ip address> too. Didn’t happen to work. Good idea.

@ttzeng thanks for double checking. Still not able to log in. Was wondering if it had something to do with the Google user credential being the same?

Any chance of creating a video of the process? There’s not too many ways to copy pastes a public key or vary the key username. Am out of ideas on this one.

Using Debian 9 in the mean time.

Thanks

@rana It’s weird… Did you clear the previous RSA key and add your ed 25519 key (~/.ssh/id_ed25519.pub) to the Clear Linux VM instance? per your previous screenshot, you configured the RSA public key to the VM, but from the ssh log, it seems no corresponding RSA private key under ~/.ssh/ folder.

To ensure you have key setup properly on your Debian9 host, what if you create a Debian VM on GCP by following the step 13, but skip the 2nd and 3rd bullets of changing boot disk. That should create a Debian VM with your SSH key, and you could test whether you can login to it with the corresponding private key?

1 Like

@ttzeng Got it! Google IAM/Service accounts for the project were mis-configured.

Creating a new Google project generated pristine IAM/Service accounts and fixed it. Was not able to identify the exact issue with the previous IAM/Service accounts. Also had to ssh-add the client computer’s private key. Was able to specify a custom username as you described in the guide.

Knowing that you validated the guide helped me stick to it and know that the issue wasn’t Clear Linux. Guide worked exactly as you wrote it. Thanks for all your help!

2 Likes

Google apparently has internal plans to offer a Clear Linux image within Google Compute Engine.

After submitting a request for Google to support Clear Linux they said:

There is already an internal feature request for this so for keeping track I’ve linked your request to the internal one.

There’s no ETA for this but you will be notified when anything changes with the request status.