LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-24-2005, 07:27 AM   #1
yekrahs
Member
 
Registered: Aug 2005
Location: England
Distribution: SUSE 10.0, LiMP (Linux Multimedia Player)
Posts: 86

Rep: Reputation: 15
Insult me, sudo!!!


I've just been experimenting with sudo (useful program), read the man pages and created a basic file from the template given.
I thought the "insults" option is a pretty neat feature, but the problem is I'm having trouble getting it to work.

I tried the line
Defaults:BOB insults
but when the password is typed incorrectly for user 'BOB' it only says "Sorry, try again".

Any suggestions?
Here's my /etc/sudoers file:

# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# User alias specification
User_Alias BOB = bob
User_Alias
SHARKEY = sharkey

# Cmnd alias specification
Cmnd_Alias KILL = /usr/bin/kill
Cmnd_Alias REBOOT = /sbin/reboot
Cmnd_Alias SHUTDOWN = /sbin/shutdown -h now
Cmnd_Alias MOUNTUSB = /bin/mount -t vfat /dev/sda1 /media/sda1Cmnd_Alias UNMOUNTUSB = /bin/umount -t vfat /media/sda1
Cmnd_Alias SHUTDOWN60 = /sbin/shutdown -h +60

# Defaults specification
Defaults>root !set_logname
Defaults:BOB insults

# Runas alias specification

# User privilege specification
root ALL=(ALL) ALL
BOB ALL = NOPASSWD: REBOOT, SHUTDOWN, SHUTDOWN60, PASSWD: KILL, MOUNTUSB, UNMOUNTUSB
SHARKEY ALL = NOPASSWD: REBOOT, SHUTDOWN, SHUTDOWN60, KILL, MOUNTUSB, UNMOUNTUSB
 
Old 09-24-2005, 08:26 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Insults must be compiled into sudo for this to work. It is my guess that Fedora Core does not have the insults enabled.
You might want to check the output of the command
Code:
strings `which sudo`
to verify that the insults are really contained in the binary.

Eric
 
Old 09-26-2005, 05:23 AM   #3
yekrahs
Member
 
Registered: Aug 2005
Location: England
Distribution: SUSE 10.0, LiMP (Linux Multimedia Player)
Posts: 86

Original Poster
Rep: Reputation: 15
hmmm... I don't think you quite caught my drift.

I just wanted to know *where* in the file you type in this option, and exactly what you type to get it to work.

(According to the Fedora man pages, all sudo options came installed as default; but it says soemthing along the lines of that it's easy to enable the "insults" option, but then doesn't give an example or say what to type).


Maybe someone with this option working could post their sudoers file???





Peace.

Last edited by yekrahs; 09-26-2005 at 05:45 AM.
 
Old 09-26-2005, 07:26 AM   #4
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
I enabled that on compile using the "--with-insults --with-all-insults" options (as well as a bunch of others) on ./configure. I have nothing in my suders file that specifies to use them, it just does because it was compiled that way.
 
Old 09-26-2005, 12:00 PM   #5
yekrahs
Member
 
Registered: Aug 2005
Location: England
Distribution: SUSE 10.0, LiMP (Linux Multimedia Player)
Posts: 86

Original Poster
Rep: Reputation: 15
Thanks for responding to the post, but I still think you don't quite get what I mean!!

I appreciate that you all have installed sudo manually on slackware, etc. However, sudo came installed as default on FC4.

Yet if you could only set such options as insults on ./configuring the file, what would be the point? What if you configured it that way but upon use of the program, decided you didn't like the insults very much? It'd hardly be a functional program if the only time you could set these options was at the configure stage!!!

But of course, programs aren't like that. All you're really doing (as I'm sure you all know already) is setting what default options you want. The whole point then is you can later set a flag to override these default settings later if you want to.


***However, what I'm really asking is *how* do you set the flag in the /etc/sudoers for insults when you _have_ installed it? As I said, the program wouldn't be much use if the only time you could set these flags was at the configuration stage
(though I know you guys did). You must be able to set these flags after installation, or there wouldn't be anything in the man files about setting them!


However, even having read the man pages, I just don't know how to set flags in the /etc/sudoers file (insults being the one I'm interested in). As I said, I tried to set the flag by typing "Defaults:BOB insults" but it didn't work.



Can anyone help?

P.S. As you said, Alien Bob, I tried typing the words: strings 'with sudo' in shell, but it just said it couldn't find the file 'with sudo'. Then I realised that perhaps you meant: sudo 'my sudoers file' , which would be: strings /etc/sudoers. When I did that, it only outputted the contents of my sudoers file, which you all know already.
 
Old 09-26-2005, 12:15 PM   #6
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
those are backticks (key to the left of 1, above tab) not quotemarks
Code:
strings `which sudo`
does something completely different to
Code:
strings 'which sudo'
 
Old 09-26-2005, 12:26 PM   #7
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
I get it. I was mearly trying to suggest that I believe this is actually a Fedora problem and not the result of the default way the normal sudo package does things.

While I can't test it, a quick google seams to suggest adding: "Defaults insults" will enable insults. Interestingly enough this keywork is excepted on my Gentoo system (which already had insults enabled anyway) but gets rejected as invalid syntax on a RHEL3 system I have at the office. Providing you are editing your sudoers file with visudo (which you should be anyway for security reasons) it should tell you on save if the tag was valid or not.

Anyway, for a full example here is what my entire sudoers file looks like:

Code:
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults specification

# Reset environment by default
Defaults        env_reset

# Enable insults by default
Defaults        insults


# Uncomment to allow users in group wheel to export variables
# Defaults:%wheel       !env_reset

# Allow users in group users to export specific variables
# Defaults:%users       env_keep=TZ

# Allow specific user to bypass env_delete for TERMCAP
# Defaults:user     env_delete-=TERMCAP

# Runas alias specification

# *** REMEMBER ***************************************************
# * GIVING SUDO ACCESS TO USERS ALLOWS THEM TO RUN THE SPECIFIED *
# * COMMANDS WITH ELEVATED PRIVILEGES.                           *
# *                                                              *
# * NEVER PERMIT UNTRUSTED USERS TO ACCESS SUDO.                 *
# ****************************************************************

# User privilege specification
root    ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
%wheel  ALL=(ALL)       ALL

# Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now

Last edited by jtshaw; 09-26-2005 at 12:42 PM.
 
Old 09-27-2005, 09:56 AM   #8
yekrahs
Member
 
Registered: Aug 2005
Location: England
Distribution: SUSE 10.0, LiMP (Linux Multimedia Player)
Posts: 86

Original Poster
Rep: Reputation: 15
I now know how to set flags in the sudoers file. However, though visudo accepts it without quibble, it looks like it really must be a problem with the rpm on the Fedora Disks. A shame.

(though I did try strings `which sudo`, there was nothing amiss when it came to the mention of insults... guess I'll just have to do it the long way and re-install from source).



Thanks for the help
 
Old 02-23-2006, 11:13 AM   #9
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
If you are still interested in this - I think it has to do with the "fortune" program which can be configured to display a random quote on every login - there are many packages lik quotes from the hitchhikers guide or from futurama and - of course - also quotes which might be concidered as an insult by some people. If I remember correctly, these quotes are also known as "offending" and need to be explicitly enabled when you install the program.
Then - sudo or whatever...will possibly insult you with different random quotes each time you log on.
 
Old 02-24-2006, 11:44 AM   #10
yekrahs
Member
 
Registered: Aug 2005
Location: England
Distribution: SUSE 10.0, LiMP (Linux Multimedia Player)
Posts: 86

Original Poster
Rep: Reputation: 15
Thanks, but I ended up migrating to SUSE anyway: suits me more, I think
 
  


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
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 03:20 PM
Insult Inside Linux Linksys HOWTO xyzxyz General 6 08-14-2005 05:17 PM
I've been banned because of their insult of Alexander Dalloz t3gah General 3 03-20-2005 01:47 PM
sudo Obie Linux - Security 3 08-04-2004 06:01 PM
need help with sudo mla Linux - Software 4 10-02-2003 11:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:19 AM.

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