LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-30-2012, 10:19 AM   #1
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Sudoers Typical Example


I've never used sudo (I've always used su -) and now have to set it so users can use MySQL Workbench (it seems pretty Ubuntu-heavy).

Anyway, reading the manual page has left me... well, confused-ish.

Is there a simple example of what goes in that file that's functionally equivalent to su -? Don't wanna be an expert, just want to use for this one purpose.

Thanks.
 
Old 11-30-2012, 10:53 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
Quote:
Is there a simple example of what goes in that file that's functionally equivalent to su -? Don't wanna be an expert, just want to use for this one purpose.
I think (I could be wrong though) to achieve your purpose 'su' can be enough: sudo is not necessary. Just create one $USER that has this and that powers to attain your end, then let other users su into that ID to perform the needed task. Sudo is too much.

Assumed that you have /etc/sudoers file because it is ubuntu. Edit this to fix some sudo user.
 
Old 11-30-2012, 10:55 AM   #3
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
http://www.linuxquestions.org/questi...do-4175438403/

So to allow a root shell you could provide "/bin/sh" or "/bin/su -" as commands.

To allow specific commands that do not allow a root shell you need to be very selective about what you allow (for instance most commands that write files once you've enabled them to write files as root have potential for changing security-related configuration).
 
Old 11-30-2012, 11:20 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Yes, it left me feeling that way too. I can't help but think the guy who wrote that man-page was more interested in showing us how clever he was rather than communicating how to actually use the damn thing.

Anyway, it's a little more complicated than this, but the basics can be summarised as:
who where=(as) options what

who can run what command(s) as which user(s), on where

'who', 'where' and 'as' and even 'what' can be specified as 'ALL' meaning any user, any host, any command etc.

e.g.
gazl ALL=(build) NOPASSWD: /home/build/kernel.SlackBuild

User gazl can run /home/build/kernel.SlackBuild as user 'build' on any host(*) without specifying a password.

Rather than read the man-page, you're better off just looking at the examples in the suders file itself, then come back and re-read the man page once you've got the basics down.

(*) sudo is not network aware, it simply allows you to share one sudoers rule file across your network and have certain rules apply to certain hosts.

Last edited by GazL; 11-30-2012 at 11:21 AM.
 
2 members found this post helpful.
Old 11-30-2012, 02:00 PM   #5
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Original Poster
Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
OK, so I added
Code:
trona ALL=(ALL) ALL
with visudoers. That appears to let "me" do stuff.

That solved one problem with getting MySQL Workbench going (it doesn't say that I'm not in "sudoers" any more anyway) but I can't start the "database server instance" for some reason or other; that's going to take some digging in the MySQL Workbench documentation, methinks.

Oh, well.

Thanks for your input.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] User not in sudoers: How to add user? Permtion Denied for sudoers file esgol Linux - Newbie 3 07-13-2012 07:44 AM
Fedora /etc/sudoers file and sudoers.d directory davejjj Linux - Newbie 2 10-21-2011 06:19 PM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM
typical newbie questions.... trueter Linux - Newbie 1 09-20-2004 03:55 AM
What is typical for each Linux distribution? markraem Linux - Distributions 1 11-02-2003 04:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration