Linux - SoftwareThis 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
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.
Distribution: SUSE 10.0, LiMP (Linux Multimedia Player)
Posts: 86
Rep:
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
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.
Distribution: SUSE 10.0, LiMP (Linux Multimedia Player)
Posts: 86
Original Poster
Rep:
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???
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.
Distribution: SUSE 10.0, LiMP (Linux Multimedia Player)
Posts: 86
Original Poster
Rep:
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.
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
Distribution: SUSE 10.0, LiMP (Linux Multimedia Player)
Posts: 86
Original Poster
Rep:
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).
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.