SlackwareThis Forum is for the discussion of Slackware 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.
There are also other groups that your regular user should be part of to be able to do "normal" things like plugging in the USB mass storage, mound CD-s etc:
There are also other groups that your regular user should be part of to be able to do "normal" things like plugging in the USB mass storage, mound CD-s etc:
Funny thing is: I had already added my user account to "power" [and I just checked it again, to make sure...) and I had set-up sudo....and still...no matter what shutdown command I type (shutdown; shutdown -h now; poweroff; halt; etc.) when in my user account, I get "command not found"- even when I use sudo.
Adding your primary user account to the "wheel" group should give you enough permissions to do reboot and shutdown sequences.
Did that too- last week.
And I could even see if I were getting the message "only root can do that"- but I get "command not found"...until I log in as root. Is that weird or what???
Hey guys, how come in Slackware, I have to switch to root in order to poweroff? (sudo, which I enabled for my regular user account, doesn't even work for that)
Make sure you use full paths to the commands; you can also add the NOPASSWD option. E.g. In my 'sudoers' file I have this line so I can run "sudo /usr/sbin/pm-suspend" (via the 'sleep' key):
Code:
myuser ALL=NOPASSWD: /usr/sbin/pm-suspend
For shutdown, just push the power button once I have yet to find a computer that doesn't shutdown cleanly if you do that.
The only thing more powerful than root access is physical access..
Make sure you use full paths to the commands; you can also add the NOPASSWD option. E.g. In my 'sudoers' file I have this line so I can run "sudo /usr/sbin/pm-suspend" (via the 'sleep' key):
Code:
myuser ALL=NOPASSWD: /usr/sbin/pm-suspend
No password sounds a little risky, even for me! (And I'm the guy who ran Windows for 9 years without updating or using AV...) (Never had a problem)
Quote:
Originally Posted by Loomx
For shutdown, just push the power button once I have yet to find a computer that doesn't shutdown cleanly if you do that.
The only thing more powerful than root access is physical access..
Hehe, I don't know why...but it pains me to do that. (Back when I first started with Linux, I must have spent an hour once, trying to figure out how to get out of console mode without hitting the power button...but finally had to.)
I suspect, like most of my computer habits and taboos, it's probably something ingrained from my Windows daze/days.
Hey guys, how come in Slackware, I have to switch to root in order to poweroff?
That is the traditional Unix multi-user philosophy. Only the superuser can shut down and reboot the machine, because that affects other users, so a regular user cannot do that.
Still there is a RedHat/Fedora/freedesktop.org way to do this as a user (from the guys who brought you systemd). On Slackware 13.37 and earlier you do
Well...at least I know it's normal then- and not that I've configured something wrong. I feel better now!
Seems easier just to switch to root, than to do all that other stuff- but sheesh! Ya'd think that they wouldn't make it so hard just to turn something off! (As you say though, I can see why- maybe like someone has a server running- and an employee is doing maintenance, and the owner doesn't want him to be able to just turn it off one day if the guy is mad or something, eh?)
Darn! If you can't count on Slackware for stability, what can ya count on?!
Continuing my Slack adventures: I just LSed into /sbin.... Wow, there's a ton of cool stuff in there! I even know what some of it is for! (Can you tell? I'm coming along nicely. 2 weeks ago, I would have started X and opened a file browser to look in /sbin...noiw I LSed from the console! Woo-hoo!)
_____
Re: Shutting down:
O-K.....just tried "sudo /sbin/poweroff" (a la Loomx) and it worked! (/sbin/shutdown" returned an error saying that it must include a time argument, and to try "now"- but for some reason, even with "now" I'd get the same message!)
If I use the XFCE desktop, I can shutdown through there via the GUI thingy.....
Seems like a lot of trouble just to turn the darn computer off! (But I'll get used to it)
______
Yet ANOTHER question:
I noticed that some of the same files in /sbin are also in /bin- only the /sbin versions seem to be symbolic links, while the /bin versions seem to be executable (?)- could anyone briefly explain what the purpose of that is? (I tried out a few of the interesting-sounding things in those directories....and I will Google some, to find out what they are!)
And...why is it that you have to type the full path to use some...and yet others can be run just by typing their name? Sheesh! The more I think I'm beginning to get a handle on this stuff...the more it seems I don't know!
I noticed that some of the same files in /sbin are also in /bin- only the /sbin versions seem to be symbolic links, while the /bin versions seem to be executable (?)- could anyone briefly explain what the purpose of that is? (I tried out a few of the interesting-sounding things in those directories....and I will Google some, to find out what they are!)
And...why is it that you have to type the full path to use some...and yet others can be run just by typing their name? Sheesh! The more I think I'm beginning to get a handle on this stuff...the more it seems I don't know!
Symbolic links are used for efficiency. There is no need to store the same file in 2 places.
If you need type the full path as a standard user (and you're running a login shell), it means that the command is not in your path, which, in turn, means that probably it's not meant to be run as that particular user. For example, a lot of administrative commands are inaccessible to standard users as they are mean to be run as root.
No password sounds a little risky, even for me! (And I'm the guy who ran Windows for 9 years without updating or using AV...) (Never had a problem)
Note that this `/etc/sudoers' line only allows that specific command without asking for a password, so hopefully not too much of a security hole..
The `ALL' means you can run it from any host.
(/sbin/shutdown" returned an error saying that it must include a time argument, and to try "now"- but for some reason, even with "now" I'd get the same message!)
And...why is it that you have to type the full path to use some...and yet others can be run just by typing their name? Sheesh!
As a normal user print the PATH variable with
Code:
echo $PATH
Then login as root print the PATH variable using the same command.
Note the difference? /sbin is in the execution path for root but not a normal user.
EDIT: Experiment with the commands as a regular user and as root. Try becoming root with the command "su" and as "su -" (hyphen). which <program> whereis <program> type <program> alias
You want to learn more about the commands above and tried the man pages but nothing was found? Try the type command (type type).
Last edited by TracyTiger; 05-09-2014 at 09:21 PM.
Reason: Extra stuff to confuse the innocent
Hmmmm..... Since installing Slack on my newly-acquired used laptop, I haven't been having any problems with LILO. Wonder iffin' the previous problems could have had something to do with my 'puter?
Quote:
Originally Posted by jtsn
BTW: You don't have to type stuff like that every time, you just learn how to script things and how to use shell aliases.
Oooo! That opens up a whole new world of possibilities, doesn't it?! It's been on agenda to learn some scripting. I think I can start soon, now that I seem to have using the terminal figured out.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.