Slackware This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-13-2008, 04:14 PM
|
#1
|
|
Member
Registered: Jul 2008
Posts: 58
Rep:
|
Adding a user to the sudoers file?
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.
|
|
|
|
11-13-2008, 04:22 PM
|
#2
|
|
Senior Member
Registered: Mar 2004
Distribution: Slackware
Posts: 4,282
Rep:
|
You can always create a sudoers file under your normal user account and then copy it in /etc (as root)
Just an idea though
|
|
|
|
11-13-2008, 04:25 PM
|
#3
|
|
Guru
Registered: Jan 2001
Posts: 24,128
Rep: 
|
Quote:
Originally Posted by annihilan
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
|
|
|
|
11-13-2008, 04:26 PM
|
#4
|
|
Slackware Contributor
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,894
Rep: 
|
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.
|
Last edited by rworkman; 11-13-2008 at 04:30 PM.
|
|
|
|
11-13-2008, 04:28 PM
|
#5
|
|
Member
Registered: Jul 2008
Posts: 58
Original Poster
Rep:
|
Quote:
Originally Posted by trickykid
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:
|
|
|
|
11-13-2008, 04:36 PM
|
#6
|
|
Guru
Registered: Jan 2001
Posts: 24,128
Rep: 
|
Quote:
Originally Posted by annihilan
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:28 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|