Score:-1

Need to create temporary user with SSH login on Google Cloud Platform

ni flag

I need to give someone temporary access to my servers on Google Cloud Platform. I want to set up my own SSH key to log in, then log in as root to create a temporary account for that person to use. However, I am having trouble using SSH to authenticate myself. I've added my ssh key in the metadata settings of my project, but I don't understand what to do next. Any guidance would be appreciated, thanks! If anyone has other recommendations for giving someone temporary access, I'd appreciate that as well!

djdomi avatar
za flag
end user question are off topic
djdomi avatar
za flag
Does this answer your question? [How to automate SSH login with password?](https://serverfault.com/questions/241588/how-to-automate-ssh-login-with-password)
John Hanley avatar
cn flag
@djdomi - Do not recommend password based login for cloud VMs. For Google Cloud, password based login is disabled by default.
John Hanley avatar
cn flag
For Google Cloud you do not need to setup SSH keys for yourself. You can use the CLI (gcloud) to connect. You can also use the Google Cloud Console GUI to connect. Once you are connected, you can use traditional Linux methods to create a user and add an SSH public key. https://cloud.google.com/compute/docs/instances/connecting-to-instance
Maheen avatar
ni flag
@JohnHanley thank you for that link! i have 5 different vm instances. do i need to create a temporary user and add an SSH public key for each one?
John Hanley avatar
cn flag
If you wish to manually issue temporary SSH keys, yes. Another method is to add the SSH public key to the VM startup script and then restart the instance - but you must repeat for each instance. https://cloud.google.com/compute/docs/connect/add-ssh-keys
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.