-1

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.

Fei
  • 1,906
  • 20
  • 36
Vin
  • 1

1 Answers1

0

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.

Vin
  • 1
  • I've installed CentOS 8 from Marketplace, and sudo worked just fine. How did you deployed the CentOS 8 VM instance? Did you configured SSH and sudoers yourself? – mebius99 Nov 01 '19 at 15:50