I'm using the google sdk shell in combination with puTTy to access a compute engine instance running debian. I have an SSH key setup and have always been able to access the server and run sudo commands as needed (for years) but in the space of a couple of hours I started getting the below message everytime I tried to sudo. I still have access and can CD, nano files etc. but if I try sudo nano it's a no go. I've never setup a sudo password (AFAIK) as I always used an ssh key - but if there's a way I will do it.
I rechecked I have editor and Compute Instance Admin (v1) roles in IAM and my key is installed
Based on other answers I tried these but got the same password request
sudo passwrd
sudo visudo
echo 'password' | sudo -S command
Can anyone help shed some light on what is going on and how to fix it?
Thanks Brad
Response
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for brad:
More Details
Google Cloud SDK Shell command
gcloud compute --project "omega-buckeye-123456" ssh --zone "asia-northeast1-c" "branding-net-2"
results in
Existing host keys found in C:\Users\xxx\.ssh\google_compute_known_hosts
Putty then opens and responds with the following
Using username "brad".
Authenticating with public key "DESKTOP-DGNOG32\brad@DESKTOP-DGNOG32" from agent
Linux branding-net-2 4.19.0-22-cloud-amd64 #1 SMP Debian 4.19.260-1 (2022-09-29) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Nov 28 06:58:10 2022 from xxx.xxx.xxx.xxx
brad@branding-net-2:~$