Created 12-10-2017 11:43 AM
Hi All-
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.
Created on 12-18-2017 03:29 AM - edited 12-18-2017 03:34 AM
Hi @SandyCT,
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.
Regards,
samurai
Created on 12-19-2017 07:29 PM - edited 12-19-2017 07:35 PM
Hi
Just fire the below command in the terminal if you are using QuickStartVm
sudo su
Created 12-20-2017 01:02 AM
Created 12-20-2017 01:06 AM
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.
Regards
Created on 12-21-2017 11:34 AM - edited 12-21-2017 11:37 AM
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?
Created 12-21-2017 11:47 AM
Hi @SandyCT,
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).
Cheers,
samurai
Created 12-22-2017 05:14 PM
Created on 12-25-2017 12:17 AM - edited 12-25-2017 12:18 AM
Hi @SandyCT,
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.
https://lintut.com/reset-forgotten-root-password-in-centos/
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! 🙂