Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Root and instance creator password?

I use the Google Compute Engine Web Console to remote into my instance. I can perform root operations using "sudo", but what if I wanted to "su" to root?

I created a user "test", and now want to log-in as "test" -- this doesn't work as I have not yet generated SSH keys. Where do I find these keys for instance creator and/or root as well?

Also, I used a Debian image, but few commands appear to be installed by default. For instance, locate, updatedb, etc are missing? How do I get these?

like image 900
Alex.Barylski Avatar asked Dec 25 '22 05:12

Alex.Barylski


1 Answers

You asked several questions in a single post; I'll answer them in order.

(1) I use the Google Compute Engine Web Console to remote into my instance. I can perform root operations using "sudo", but what if I wanted to "su" to root?

Use: sudo su -


(2) I created a user "test", and now want to log-in as "test" -- this doesn't work as I have not yet generated SSH keys. Where do I find these keys for instance creator and/or root as well?

You can ssh via gcloud compute ssh or by clicking on the "SSH" button on the web UI, and then run: sudo su test.


(3) Also, I used a Debian image, but few commands appear to be installed by default. For instance, locate, updatedb, etc are missing? How do I get these?

To install missing packages, you'll have to use the standard Debian command apt-get to install the packages, e.g.:

$ sudo apt-get install [name-of-package]

To find a package name using keywords, use:

$ apt-cache search [keyword]

Note: the first thing you want to do on a brand-new instance is to update your package metadata cache by running:

$ sudo apt-get update
like image 155
Misha Brukman Avatar answered Jan 14 '23 05:01

Misha Brukman