[SOLVED] Slackware unable to shutdown or reboot user account "command not found".
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
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.
Slackware unable to shutdown or reboot user account "command not found".
First off, this is my first post in the forums. Secondly, I am new to slackware.
I'm unable to shutdown my regular user account, I have added myself to the wheel and power groups and edited the sudoers file in Vi as it says. Also, Visudo seems to not work for the regular user as well. Any help would be much appreciated
visudo is used to edit the sudoers file which is used to grant superuser (root) authority to run other commands. Due to this regular users should NOT be able to run the command - only the root user.
"shutdown" and "reboot" deal with stopping or stopping/restarting the entire OS so there is no such thing as shutting down or rebooting a user. User's simple "exit" or "logoff".
You'd have to post the values from your sudoers file (the one visudo edits) for anyone to tell you more about it. However, "command not found" generally means that either the command (file) does not exist OR (more often) that the user trying to run it does not have the directory it lives in within their PATH variable and have not given the fully qualified path name of the file.
e.g.
cp is a command in /bin on many systems. The fully qualified path to cp is "/bin/cp". One could always type "/bin/cp" when using the command and it should work because it always knows where it is due to being told where it is. However, it is more usual to simply type "cp" and let it search your PATH variable to find it.
If you type "echo $PATH" you'll see what directories (separated by colons) are searched to find commands.
When you are the root user you usually have a different PATH than regular users because the admin commands are used by root but not by regular users. "shutdown" and "reboot" commands are admin commands usually in /sbin.
## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##
##
## Host alias specification
##
## Groups of machines. These may include host names (optionally with wildcards),
## IP addresses, network numbers or netgroups.
# Host_Alias WEBSERVERS = www1, www2, www3
##
## User alias specification
##
## Groups of users. These may consist of user names, uids, Unix groups,
## or netgroups.
# User_Alias ADMINS = millert, dowdy, mikef
##
## Cmnd alias specification
##
## Groups of commands. Often used to group related commands together.
# Cmnd_Alias PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
# /usr/bin/pkill, /usr/bin/top
##
## Defaults specification
##
## You may wish to keep some of the following environment variables
## when running commands via sudo.
##
## Locale settings
# Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
## Run X applications through sudo; HOME is used to find the
## .Xauthority file. Note that other programs use HOME to find
## configuration files and this may lead to privilege escalation!
# Defaults env_keep += "HOME"
##
## X11 resource path settings
# Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
##
## Desktop path settings
# Defaults env_keep += "QTDIR KDEDIR"
##
## Allow sudo-run commands to inherit the callers' ConsoleKit session
# Defaults env_keep += "XDG_SESSION_COOKIE"
##
## Uncomment to enable special input methods. Care should be taken as
## this may allow users to subvert the command being run via sudo.
# Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
##
## Uncomment to enable logging of a command's output, except for
## sudoreplay and reboot. Use sudoreplay to play back logged sessions.
# Defaults log_output
# Defaults!/usr/bin/sudoreplay !log_output
# Defaults!/usr/local/bin/sudoreplay !log_output
# Defaults!/sbin/reboot !log_output
##
## Runas alias specification
##
##
## User privilege specification
##
root ALL=(ALL) ALL
pino ALL=(ALL) ALL
## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL
%pino ALL=(ALL) ALL
## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
## Uncomment to allow members of group sudo to execute any command
# %sudo ALL=(ALL) ALL
## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw # Ask for the password of the target user
# ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'
## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d
If you've got the ALL = ALL specification then you should be able to run any command but you'd have to preface it with "sudo"
e.g. to run "visudo" as any user with such a specification you'd have to run "sudo visudo" and input that user's password when prompted.
At that point the PATH becomes important as previously disucssed. Running commands with root privilege via sudo is NOT the same as running them with root's environment (including PATH).
iirc, it ultimately has to do with consolekit/policykit etc.
Tho the post is a bit dated, I *believe* it still applies.
*EDIT* -- just tried my own advice and it no longer works, apologies. There is a post by rworkman in the same thread that appears relevant to editing sudoers, etc.
If you've got the ALL = ALL specification then you should be able to run any command but you'd have to preface it with "sudo"
e.g. to run "visudo" as any user with such a specification you'd have to run "sudo visudo"
Still showing command not found, at least I know it has to do with a path. How would I create a new path or edit it in /etc/profile as /.bash_profile and bashrc don't exist.
Note that order they are defined in is the order they'll be searched and it will stop when it finds the command. So with the above sample PATH if /usr/bin/sqlexec existed and also /usr/local/bin/sqlexec existed and you typed just "sqlexec" without specifying which one it would use the one in /usr/bin because it found that first.
You can add to the PATH simply by adding ":newdir" to the end of the existing PATH or by adding a new line below it that appends it to the existing variable such as:
PATH=$PATH:newdir
Sometimes you do the latter because it isn't clear what all is going into the PATH based on other files being sourced during the login.
In above "newdir" would be the directory you wish to add such as ":/sbin".
Typically there should also be a location where it does "export" of "PATH" (often along with other variables) to make the defined PATH available.
Slackware unable to shutdown or reboot user account "command not found".
make sure that user is in power group. and then it will work through the policy-kit. on all the desktop environments.
from command line assume root then type reboot or shutdown -h now
keep it simple.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.