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.
I know how to add the user to the file basically, but how can I set this for a more or less normal user, with normal privileges and that I sudo to install and such? I have NO idea how to use vi, seriously it hurts my head.
I know how to add the user to the file basically, but how can I set this for a more or less normal user, with normal privileges and that I sudo to install and such? I have NO idea how to use vi, seriously it hurts my head.
Don't use vi, the proper way is to use visudo command to edit sudoers. It'll prompt if you make mistakes and it also locks the file while it's being edited.
vi is easy though, here are some of the basics:
i = insert mode (edit mode)
esc = command mode
x = delete present character
dd = delete whole line
dw = delete current word
o = start new line for editing from present line
a = start editing one character to the right
wq = write and quit
Shift+ZZ = write to the file and quit
The sudo package shipped in Slackware right now doesn't seem to respect VISUAL or EDITOR from the environment - see visudo(8) and the configure flags used in the build script for why
In other words, learn to use vi :-)
EDIT: Pat just pointed out my oversight in the man page :/
I'm leaving the above text here though, as I don't much like to cover up errors :-)
From visudo(8):
Quote:
There is a hard-coded list of editors that visudo will use set at compile-time that may be overridden via the editor sudoers Default variable. This list defaults to the path to vi(1) on your system, as determined by the configure script. Normally, visudo does not honor the VISUAL or EDITOR environment variables unless they contain an editor in the aforementioned editors list. However, if visudo is configured with the --with-enveditor flag or the enveditor Default variable is set in sudoers, visudo will use any the editor defines by VISUAL or EDITOR. Note that this can be a security hole since it allows the user to execute any program they wish simply by setting VISUAL or EDITOR.
Don't use vi, the proper way is to use visudo command to edit sudoers. It'll prompt if you make mistakes and it also locks the file while it's being edited.
vi is easy though, here are some of the basics:
i = insert mode (edit mode)
esc = command mode
x = delete present character
dd = delete whole line
dw = delete current word
o = start new line for editing from present line
a = start editing one character to the right
wq = write and quit
Shift+ZZ = write to the file and quit
The thing is, I don't know how to actually do the commands, I su to root and then visudo, and then the content appears in my terminal window, I add what I want in, and then I can't figure out how to save it, where do I put in ZZ?
Help......... D:
The thing is, I don't know how to actually do the commands, I su to root and then visudo, and then the content appears in my terminal window, I add what I want in, and then I can't figure out how to save it, where do I put in ZZ?
Help......... D:
You can either then press ESC to go back into the command mode and issue :wq! to save and quit and or do a Shift+ZZ in command mode to quit and save.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.