Can't access VM Instance through SSH

Solution 1:

From the issue at hand the command chimed-R 755 will give everybody root permission Try this first before reading other steps down. Ssh into your instance. To change password Just type Sudo passwd Type new password And confirm new password.
If that doesn't work, Follow the steps below

"/usr/bin/sudo must be owned by uid 0 and have the setuid bit set"

This means the sudo root permission has been over written, which creates restriction of using sudo and it leads you into problems like all the root access you lost. The following steps should help resolve the issue

create a backup or snapshot of your instance

Create a totally new instance and detach your local ssd from the last instance attach, it back to the newly created instance.

Login to new instance and create a new folder in the root, and start operation as root.

check the attached drive in new instance : “mount”…… “fdisk -l | grep Disk”.

Create new folder in root directory : “mkdir /newfolder”

Now mount the vol : “sudo mount /dev/xvdf1 /newfolder/”

After mount if you check the permission you will see that the newfolder permission got changed after mounting because of the effected volume: