Search code examples
google-cloud-platformgoogle-compute-enginesudo

GCE sudo asking for password


My GCE instance has suddenly started asking for a password when using sudo, no idea what has changed

Like this: Google Cloud VM when sudoing asks for password

However I really don't want to use the provided solution of deleting and recreating my instance, there must be a simple way to prevent sudo asking for a password?


Solution

  • Ah OK, I was being stupid. My SSH keys had an expiry date and that was why sudo was asking for a password. Just change expiry date and everything works again.