UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
Well, oops.. 'chmod 777 /usr/bin/*' sets the mode of all files exactly to 777. In particular, SUID bit (that means that the binary is executed with root privileges initially, but knows who called it). And the only way a process started by an ordinary users gains root privileges is through a similar SUID "gate". So you need to chmod sudo executable 'u+s'. For it you will probably need to boot from installation media and mount your system.
Shouldn't it be enough to boot into single-user mode? That should give a root login without passwords usually..I haven't tried with Ubuntu recently, but that's probably easier than booting off the installation media and mounting the partitions..
When GRUB pops up, enter the menu, press 'e' to edit the boot section you usually use (the hilighted one I guess; it should tell about the 'e' button at the bottom), hilight the line that starts with word 'kernel', press 'e' again to edit the line, add the word 'single' to the line among the other options, press ENTER and 'b' to boot. Hopefully you end up logged in as root on the command line..then issue the chmod explained in the previous post and reboot.
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
I'd say that booting from LiveCD is simpler sometimes. Personally I would use not just single-user mode, but plainly init=/bin/sh, but whatever of these ways you choose, you have to remember about Ctrl-Alt-Del and how should it work here, without init you even need to think about filesystem state on reboot.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.