Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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: I favor Slackware, CentOS and Debian
Posts: 25
Rep:
sudo with alias
Hi I wonder if someone good in sudo can explain how to use
Runas_Alias DB = #1000 (where #1000 should be an user id)
user #1000 is johan on the system.
I have read a lot of sudo and get the basics, but this I don't understand. Especially Howto use this option
Runas_Alias DB = #1000
I have use visudo to edit the file.
Is this done to anything useful?
this is my 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.
#
# Host alias specification
Host_Alias HB =pingvin
# User alias specification
# Cmnd alias specification
# Defaults specification
# Runas alias specification
Runas_Alias DB = #1000
# User privilege specification
#root ALL=(ALL) ALL
johan ALL=(ALL) ALL
pernilla HB= (DB) 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
I haven't got a clue about sudo, but I am wondering if that pound sign ( # ) before the 1000 is causing any trouble?
Technically, that would be commenting out the user number, wouldn't it?
SVA
Last edited by GrapefruiTgirl; 05-09-2008 at 08:24 PM.
Reason: typo
Thank you for your explanation.
No actually I did escape shell correct! \#uid
, but what i did not understand with synopsis was sudo -u \#uid (with option -u) so I mean I interpreted [-u username|#uid] as sudo -u username or just sudo \#uid (without -u), and that last option obviously was wrong! But from now on I know!
Thank you for your explanation.
No actually I did escape shell correct! \#uid
, but what i did not understand with synopsis was sudo -u \#uid (with option -u) so I mean I interpreted [-u username|#uid] as sudo -u username or just sudo \#uid (without -u), and that last option obviously was wrong! But from now on I know!
Yeek those green colors are rotten! lol, before someone gets bent out of shape from going cross-eyed from them, kindly maybe use BOLD rather than that icky green color.
Thank you for your explanation.
No actually I did escape shell correct! \#uid
, but what i did not understand with synopsis was sudo -u \#uid (with option -u) so I mean I interpreted [-u username|#uid] as sudo -u username or just sudo \#uid (without -u), and that last option obviously was wrong! But from now on I know!
The colours *are* nasty, alright. :}
And why do have two user-accounts? And what did you dig
the older one up for this response? :D
Yes! You may be right about the colour. I will consider using bold next time. But the main reason for this whole discussion was that I wanted to understand how sudo works and at the same moment deeping the understanding generally for howto read / understand the synopsis of man page and hopefully at the same time help somebody else, that is not always so absolut and clear for a newbie. I got to know about Linux august 2005 and learned a great deal, but sure there is still alot to learn.
cheers!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.