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.