google-compute-engine"/>
  • 12
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

I'm running an Ubuntu 20.04 instance in Compute Engine providing SSH access through OS Login.

User has set Compute OS Admin Login role and can run commands via sudo without specifying a password. Is there any way to change this? I would like sudo ask for user password.

I have changed all ALL=(ALL) NOPASSWD:ALL occurrences by ALL=(ALL) ALL in /etc/sudoers.d/* and /var/google-sudoers.d/username_domain_ext files without success.

Any ideas?

If I comment #includedir /var/google-sudoers.d in /etc/sudoers.d/google-oslogin users lose privileges to run sudo. That leads me to think they must be something to do with /var/google-sudoers.d/username_domain_ext file to force sudo ask for a password.

Finally, sudo -l seems to return what I want:

username_domain_ext@hostname:~$ sudo -l
Matching Defaults entries for username_domain_ext on hostname:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User username_domain_ext may run the following commands on hostname:
    (ALL : ALL) ALL

Thanks in advance.

      • 1
    • It is my understanding that there are no passwords (OS Login uses SSH keys). Are you setting user passwords on the instance somehow?
    • Thanks for your comment. It has made me see the light. Although it is a Google Identity user with a password, it does not seem to work within the Compute instance. Trying to change password from shell throws this error: passwd: Authentication token manipulation error and passwd: password unchanged

Here is the link of how to set sudo to prompt for password. You need to use the sudo visudo command

  • 0
Reply Report

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags