Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Thanks for your reply Chris. I'm not sure what you mean. Are you saying there's no way of doing it without logging in as root? If there's a way of doing it without logging in as root, I'd love to know.
Thanks for your suggestions. Using sudo was a particularly good idea. Unfortunately it doesn't seem to have worked.
I've had to read up about it, cos I hadn't heard of it before; but I'm 99% certain that I know how to use the command now, that what I've done is correct and that it should work. My sudoers file now looks like this:
#User privilege specification
root ALL=(ALL) ALL
reetep pc=(root) /sbin/init
typing sudo -l as reetep gives:
User reetep may run the following commands on this host:
(root) /sbin/init
yet when I type "/sbin/init 5" I still get the same error message:
init: must be superuser.
The same applies even when I modify sudoers as follows:
#User privilege specification
root ALL=(ALL) ALL
reetep ALL=(ALL) ALL
ie I still get the same error message "must be superuser."
I'm very grateful for the help you've given. Unless any other ideas spring immediately to mind, then don't worry about it and many thanks. I'm just writing this because I thought you might be interested to hear whether it worked.
On the other hand if ideas do spring to mind then please help. I'd be very grateful! I know I can just switch to root when I need to use the command, but I do it quite a lot (the startkde command doesn't work you see, but init 5 will load the kde desktop), and I don't feel comfortable working as root all the time (as I've heard that you can really trash your system).
Of course, if no-one has any ideas, then I can try my luck with a thread on fixing the real problem here -that is the startkde command.
PS I know that I can change the inittab to load level 5 as default, but I like to load to 3 so that I can choose between windowmaker and the kde/gnome desktop. So that's not a quick fix either really. Thanks, reetep.
Distribution: Mandrake as base, most software hand rolled
Posts: 80
Rep:
Re: using init command
Quote:
Originally posted by reetep I'd like to be able to use the init command without logging in as root. I get the following message at the moment:
[reetep@pc reetep]$ /sbin/init 5
init: must be superuser.
You can't use init without being root (init checks that the EUID is 0). You need to set the setuid bit on /sbin/init (bad idea) or use sudo.
BTW, you need to type 'sudo /sbin/init 5', not just '/sbin/init 5'. It's not because you're in sudoers that it will suddenly magically work - you need to run your stuff through the sudo command.
Thanks robartes, you've done it for me. I WAS actually running /sbin/init through the sudo command, except I was typing sudo | /sbin.init 5, as suggested by the manual. (Or at least that's what I think the manual says you should do. Maybe I'm not interpreting the syntax statement properly).
But anyway sudo /sbin/init 5 does it, (I same thing without the pipe), so thanks a lot everyone. You guys are great!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.