Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
01-22-2010, 12:23 AM
|
#1
|
Member
Registered: Mar 2008
Location: Bengaluru, India
Distribution: RHEL 5.5, Solaris 5.10
Posts: 215
Rep:
|
how to allow a user to manage the users?
hi all...i want to allow the user winny to manage users...
i have added the following lines to the visudo file.
#user alias specification
User_Alias LIMITEDTRUST = winny
#command alias specification
Cmnd_Alias MINUMUM = /usr/sbin/useradd, /usr/bin/passwd, /usr/sbin/groupadd, /usr/sbin/usermod, /usr/sbin/userdel
#user privilege specification
LIMITEDTRUST ALL=MINIMUM
then i logged in as a user winny, and fire the following command
#sudo username linus
then it prompt me for a password, i dont know which password has to be given, i gave the user winny's password. I was told "sorry, try it again", then i gave the root user password. Same error was persist. when i fired the sudo username command second time it said useradd command not found.
How to solve this issue?
|
|
|
01-22-2010, 12:27 AM
|
#2
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,440
|
winny@somehost> sudo /usr/sbin/useradd <someparam> <...> new_user_login
and supply the passwd for winny.
See http://linux.die.net/man/8/useradd
|
|
|
01-25-2010, 01:28 AM
|
#3
|
Member
Registered: Mar 2008
Location: Bengaluru, India
Distribution: RHEL 5.5, Solaris 5.10
Posts: 215
Original Poster
Rep:
|
hi there is a small problem in saving my visudo file?
Quote:
40
41 ## Delegating permissions
42 Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp
43
44 ## Processes
45 Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall
46
47 ## Drivers
48 Cmnd_Alias DRIVERS = /sbin/modprobe
49
50 # Defaults specification
51
52 #
53 # Disable "ssh hostname sudo <cmd>", because it will show the password in clear.
54 # You have to run "ssh -t hostname sudo <cmd>".
55 #
56 Defaults requiretty
57
58 Defaults env_reset
59 Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \
60 LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \
61 LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \
62 LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \
63 LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \
64 _XKB_CHARSET XAUTHORITY"
65
66 ## Next comes the main part: which users can run what software on
67 ## which machines (the sudoers file can be shared between multiple
68 ## systems).
69 ## Syntax:
70 ##
71 ## user MACHINE=COMMANDS
72 ##
73 ## The COMMANDS section may have other options added to it.
74 ##
75 ## Allow root to run any commands anywhere
76 root ALL=(ALL) ALL
77
78 ## Allows members of the 'sys' group to run networking, software,
79 ## service management apps and more.
80 # %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS
81
82 ## Allows people in group wheel to run all commands
83 # %wheel ALL=(ALL) ALL
84
85 ## Same thing without a password
86 # %wheel ALL=(ALL) NOPASSWD: ALL
87
88 ## Allows members of the users group to mount and unmount the
89 ## cdrom as root
90 # %users ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom
91 ## Allows members of the users group to shutdown this system
92 # %users localhost=/sbin/shutdown -h now
93
94 #user alias specification
95 User_Alias LIMITEDTRUST = winston
96 Cmnd_Alias MINIMUM =/usr/sbin/useradd, /usr/bin/passwd, /usr/sbin/groupadd, /usr/sbin/usermod, /usr/sbin/groupdel, usr/sbin/userdel
97 #user privilege specification
98 LIMITEDTRUST ALL=MINIMUM
|
plz concentrate on the last 15 lines...i just added the /usr/sbin/userdel command in the cmnd alias section. when i tried to save, it gave some syntax error...the error is
[root@kingston etc]# visudo
Warning: undeclared Cmnd_Alias `MINIMUM' referenced near line 93
>>> sudoers file: syntax error, line 90 <<<
Warning: undeclared Cmnd_Alias `MINIMUM' referenced near line 93
What now? e
>>> sudoers file: syntax error, line 90 <<<
Warning: undeclared Cmnd_Alias `MINIMUM' referenced near line 93
What now?
But the line no 93 is emplty...i am little bit confusing....
|
|
|
01-25-2010, 01:46 AM
|
#4
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
Quote:
Originally Posted by kingston
then i logged in as a user winny, and fire the following command
#sudo username linus
then it prompt me for a password,
|
The command "username" (whatever that maybe) was not listed in the config you posted. In these cases I think sudo plays dumb and just asks for a password.
Evo2.
|
|
|
01-25-2010, 01:54 AM
|
#5
|
Member
Registered: Oct 2008
Location: Pakistan, Islamabad
Distribution: CentOS, Fedora, Solaris
Posts: 154
Rep:
|
i have tried this but actual error is on line this
LIMITEDTRUST ALL=MINIMUM
undeclared Cmnd_Alias `MINIMUM' referenced near line
i dont the actual syntax
|
|
|
01-25-2010, 01:57 AM
|
#6
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,440
|
Its difficult to say, but
Quote:
>>> sudoers file: syntax error, line 90 <<<
|
leads me to believe that somewhere, possibly line 90 or close before, you've got an actual newline break in the middle of a declaration. This is not allowed, you either use a wide line or with default vim line-wrapping or escape a newline with '\' see these examples http://linux.die.net/man/5/sudoers
|
|
|
01-25-2010, 02:58 AM
|
#7
|
Member
Registered: Oct 2008
Location: Pakistan, Islamabad
Distribution: CentOS, Fedora, Solaris
Posts: 154
Rep:
|
i found error
which is in line of last command
Cmnd_Alias MINIMUM =/usr/sbin/useradd, /usr/bin/passwd, /usr/sbin/groupadd, /usr/sbin/usermod, /usr/sbin/groupdel, usr/sbin/userdel
this is the Error:
, usr/sbin/userdel
every thing is fine
|
|
|
01-25-2010, 03:06 AM
|
#8
|
Member
Registered: Mar 2008
Location: Bengaluru, India
Distribution: RHEL 5.5, Solaris 5.10
Posts: 215
Original Poster
Rep:
|
it screwed up me a lot...i simply reinstalled the sudo rpm...and configured again...as chrism told,
Quote:
winny@somehost> sudo /usr/sbin/useradd <someparam> <...> new_user_login
and supply the passwd for winny.
|
i fired the command "sudo /usr/sbin/useradd winny", first time i was asked a password. i gave the password of winston. Next time when i add a user it didnt ask anything. It works well...thanks to all
|
|
|
01-25-2010, 03:08 AM
|
#9
|
Member
Registered: Mar 2008
Location: Bengaluru, India
Distribution: RHEL 5.5, Solaris 5.10
Posts: 215
Original Poster
Rep:
|
ok sohail...thanks i got it now....
|
|
|
All times are GMT -5. The time now is 03:33 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|