I did some chmod/chown changes on all and since then I am not able to login with root user.
sudo command is not working.
Tried all the options available online, still getting this error-
"sudo: effective uid is not 0, is sudo installed setuid root?"
I know that the uid for the file /usr/bin/sudo must be set to 0 but currently it is 1 and i am not able to change it.
As soon as I launch the VM it opens with user "cloudera" by default.
Is there any way to launch the VM with root user?
Anyone know if this can be fixed while restarting the VM?
Just want to fix this without re-installing the complete VM. Thanks, appreciate any help/insights on this.
can you give us more details? For example, which version of the Cloudera QuickStart VM are you using?
There is a way to log in as root, but it's non-trivial, so I suggest we confirm there's no other way.
For starters, can you post the output of
"ls -la /usr/bin/sudo" from that QuickStart VM?
These virtual machines are based on Centos 6.4, which by default can be rebooted in "safe mode", which should give you access to both your hive data, and the fix to the sudo ownership.
But if you ask me, I would
1) fix sudo
2) back up all I need from that VM (hive, etc), and
3) start from scratch, using those backups.
If you did what I think you did, sudo will not be the only thing that is not working.
Actually, suggestion from @csguna gives me an idea - @SandyCT, if you can open a normal terminal, you can also execute "su -" as command. It will ask for root password, so try to give it same default password you had for cloudera user - by default it is "cloudera". If you are lucky, and "su" binary is unaffected by your chmod/chown, you just might get to root, and from there we'll manage.
Please try, and let us know.
Hi, @csgunathanks for your reply, this solution wont work. I have been using sudo for a long time but this occurred after a permission change using chmod 777 and now "sudo su" wont work, I am getting below error:-
sudo: effective uid is not 0, is sudo installed setuid root?
you should try the suggestion from my last message - if you didn't break "su" binary as well, command "su -" might give you root access. When prompted, give it the root password ("cloudera" by default, if you haven't changed it).
well, this system is broken a bit more than I expected, since owner of groups is also damaged. What did you run exactly? If I had to guess, some recursive chmod on /, or /etc?
Before you try this last option, try switching to console (ctrl+alt+F1 on a normal pc, not sure about the vm), and logging in as root, with password "cloudera".
If this does not work, for whichever reason, here's a way to reboot Centos 6 in "safe mode". I suggest you make a backup of the whole vm file/directory first.
If this does not work (I cannot test now, since I don't have my vm around), replace " 1 " in the tutorial with "rw init=/bin/bash"
In either case, this will grant you root, but fixing your vm might take a while. For example, your sudo command should be "---s--x--x", or something to that regard, /etc/sudoers "-r--r-----", and "/etc/group" -rw-r--r--.
Have fun & good luck! 🙂