View Single Post
Old 13th July 2014
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

Quote:
Originally Posted by cravuhaw2C View Post
During installation I did not create a user account. What I did was to give a password to the root account only.

Does the root account have permission to execute shutdown?
You need to be more clear in the future. If you're root, why would you bother invoking sudo? What error message did you receive? These are things that will get your question answered correctly the first time. Of course root can issue shutdown.

Quote:
Originally Posted by cravuhaw2C View Post
Suppose I did create a user account during installation and suppose I invoked the visudo command, how do I give myself additional access? I have read the man pages and FAQs and I am still unable to make sense of all the parameters stated therein. I don't have IT, computer or technical qualifications.
Log in as root and invoke visudo. If you just want your user to be able to shut down the system, uncomment the very last line:
Code:
# %users  localhost=/sbin/shutdown -h now
Though I'd probably change that to -hp so you get the auto-poweroff.

If you want your user to do everything root can do, you'll see this line:
Code:
root    ALL=(ALL) SETENV: ALL
copy that on a blank line below, changing root to whatever your username is.

If you actually care about doing things securely, learn something about sudo. There's even a book appropriately titled Sudo Mastery: User Access Control for Real People by one of the most (if not the most) respected author in BSD books.

Quote:
Originally Posted by cravuhaw2C View Post
Thanks for the info. Could you tell me what those restrictions are on the use of su?
If your user is not in the wheel group then you can't use su(1). Full stop.

Quote:
Originally Posted by cravuhaw2C View Post
Gentle note to ocicat: I know you were trying to help me as much as you could and I appreciate it. However the hypertext links that you created for sudo(8), visudo(8), shutdown(8) and su(1) led me to a "Bad Request - You specified an invalid manpath."
We changed our online man page format. The administrators here have not updated their commands for that. But the change happened only recently; give them some time to catch up.

However, you're clearly running OpenBSD so you have no excuse not to type 'man X page' yourself.
Reply With Quote