question

RavinaNitwalDigital-4214 avatar image
0 Votes"
RavinaNitwalDigital-4214 asked ·

How to reset or undo the changes made by sudo chmod -R 777 /usr/bin/ command?

I accidentally ran sudo chmod -R 777 command on /usr/bin/

And now I am getting the following error >>

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

I can't access the root as Azure VMs don't provide root password and can't use sudo.

Is there any way I can undo this or make sudo work again?
Can someone from the azure support team reset it using their root credentials??

azure-virtual-machines
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Did that help answer your question?
Please "Accept as answer" wherever the information provided helps you to help others in the community.

0 Votes 0 · ·

1 Answer

karishmatiwari-msft avatar image
0 Votes"
karishmatiwari-msft answered ·

Hello,

It looks like the permissions were changed for the sudo utility. You can log in the Serial Console via the Azure Portal with root user. Try this and let me know the results:

  1. Log into the system as the root user

  2. Run command: 'chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo'



· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.