Slackware - InstallationThis forum is for the discussion of installation issues with Slackware.
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.
I am running Slackware 13.37. The latest release.
And I am learning.
I am trying to use the sudo command and it says I am not in the Sudoers file.
How do I fix this? Do I add my username to the group file?
I mean to ADM user or other root type user in that file? And yes I am in that file. But it doesn't seem to matter.
I am running Slackware 13.37. The latest release.
And I am learning.
I am trying to use the sudo command and it says I am not in the Sudoers file.
How do I fix this? Do I add my username to the group file?
I mean to ADM user or other root type user in that file? And yes I am in that file. But it doesn't seem to matter.
You would normally edit the sudoers file with the...
Would you or someone please provide me the commands to make once in the sudoer file?
And if this is the vi editor, how to I save what I do, and how do I get out of this editor??
I must learn VI but I keep putting it off.
Quote:
Originally Posted by custangro
You would normally edit the sudoers file with the...
If you are going to use sudo with slack you should add /usr/local/sbin /usr/sbin and /sbin to the path of your regular user as it will make life much easier. Additionally put the command 'complete -cf sudo' somewhere appropriate like your ~/.bashrc if you want command completion. Though before you do all that reconsider the advice from schmatzler and alekow regarding just using su.
The thing about sudo is that it works best when you have multiple admins on the same machine or want to grant access to individual commands to specific users. However for a personal machine it is pretty much pointless IMHO and for that reason I never understood why Ubuntu pushes it so hard given their primary target market.
Anyway, here are my thoughts from a similar thread in the past:
Quote:
Originally Posted by ruario
Consider if I wanted to run the fake command 'example' once as a root user. Here is what I would actually have to type (where $password is my actual password).
Using su:
su[Enter]$password[Enter]example[Enter][Ctrl]+d
(Note: That is '[Ctrl]' and 'd' together to exit the root session, you obviously aren't typing the '+' character)
Using sudo:
sudo[space]example[Enter]$password[Enter]
Ignoring the characters needed that are the same in both cases (i.e. 'example' followed by [Enter] and your password followed by [Enter]), you have to type 5 key presses to execute a single command as root via 'su' (s u [Enter] [Ctrl] d) and 5 key presses to execute a single command as root via 'sudo' (s u d o [space]). Or to put it another way, you save nothing using sudo.
If however you wanted to type two or more commands as root, you immediately start saving on the key presses by using 'su' instead of 'sudo'. Yes the second 'sudo' command does not require a password but as long as you have not closed your root session yet (i.e. no Ctrl+d) you don't have to type your password again with 'su' either and you save having to write 'sudo' for every single line.
There is also the point that outside of distros where 'sudo' is preconfigured (e.g. Ubuntu and derivatives) you save time configuring '/etc/sudoers' and setting up various admin variables for your regular user.
Indeed the other nice thing with using 'su' is that you can just open a root terminal for all your admin needs and you decide if and when you should close it, rather than relying on preconfigured time-out periods with 'sudo'.
Last edited by ruario; 06-28-2012 at 01:54 PM.
Reason: Added a note about 'complete -cf sudo'
You can use the editor you like by typing in command such as:
Code:
EDITOR="mcedit" visudo
or similar.
I believe Slackware's visudo is hard-coded to run vi.
Code:
man visudo
There is a hard-coded list of one or more editors that visudo will use set at compile-time that may be
overridden via the editor sudoers Default variable. This list defaults to "/usr/bin/vi". 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-env-editor option or the
env_editor 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.
I believe Slackware's visudo is hard-coded to run vi.
Code:
man visudo
There is a hard-coded list of one or more editors that visudo will use set at compile-time that may be
overridden via the editor sudoers Default variable. This list defaults to "/usr/bin/vi". 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-env-editor option or the
env_editor 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.
Believe is irrelevant when it comes to technical systems. A short look into the Slackbuild for sudo reveals that it is compiled with the "--with-env-editor" option. So specifying and editor works fine.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.