简体   繁体   中英

Google Compute Engine instance requires password for sudo - what is my password?

I have a new google compute engine instance. I am SSH'ed into the instance using certs. Whenever I try to use sudo it asks for the primary user's password which I do not have. Just recently I setup an instance on centos 7 and did not have this issue.

The instance is running centos 8. Normally, I would ssh to the instance, then execute commands using Sudo. For example, I would like to set the root password.

if I run sudo passwd , sudo su - or even sudo cat /var/log/messages it asks me for the primary user's password. The problem is I do not have that password.

[primaryuser@server4 log]$ **sudo cat messages** 

**[sudo] password for primaryuser:** 

##########

[primaryuser@server4 log]$ **sudo passwd**

**[sudo] password for primaryuser:** 

I expected to run the commands using sudo but do not have the password.

Does anyone have any ideas? I read other posts about similar problems but different from mine.

I had to give up and use ubuntu. Everything acted as expected on ubuntu and I was able to set the password. I believe the problem is limited to centos 8 but I am not certain.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM