LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 08-15-2007, 02:56 PM   #1
Julix
LQ Newbie
 
Registered: Aug 2007
Location: Argentina
Distribution: Debian Etch, Slackware 12
Posts: 28

Rep: Reputation: 15
Resetting passwords of other users without being Root


Hi Everyone,
I am a newbie and have recently installed Linux at home, although right now it is only for testing purposes I want to set it up as a multiuser system and I would like to know if there is a way to reset passwords of other users without being Root and without using SUDO. I mean like setting up a user group with that privilege only and then connect User IDs to that group who should reset the password of other users.
Sorry if this question may have been posted on another forum but I have looked around and couldn't find an answer.
Thanks,
Julix
 
Old 08-15-2007, 03:15 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
This is not possible. Well, not possible in any sane way. I'm not sure what effect creating a 'password_editor' group, making /etc/passwd and so on owned by that group, and making it group-writable would have, but it's not anything you want or need.
 
Old 08-15-2007, 03:29 PM   #3
jonlake
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Rep: Reputation: 31
Why not sudo?

This is exactly what sudo is designed for. To allow normal users to do things that is usually reserved for root. You can specify a group that has access to only the passwd command to reset passwords. The only downfall to this is that this particular user could probably sudo passwd root and reset the root password.
 
Old 08-15-2007, 04:01 PM   #4
Julix
LQ Newbie
 
Registered: Aug 2007
Location: Argentina
Distribution: Debian Etch, Slackware 12
Posts: 28

Original Poster
Rep: Reputation: 15
Post

Thank you Digiot and Jonlake, both point of views make sense. Basically what I want to archive is that a user with that the user with this privilege don't has put sudo everytime a password needs to be reset for a user. So if I setup the user ID with SUDO for password reset there is no way to avoid that the root password can also be reset by this particular user?
 
Old 08-15-2007, 05:02 PM   #5
jonlake
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Rep: Reputation: 31
Maybe..

Something like this would work
Code:
#!/bin/bash
# users run this command as sudo script user
if [ "$1" = 'root' ]; then 
  echo "You cannot change the root password!!"
  exit
else 
  passwd $1
fi
and give them sudo to this command. I am just guessing that this would work, I'm not at a linux box right now to test.

I did a little bit of searching to see if there was a pam module or something to avoid someone running sudo passwd root, but I haven't found anything.
 
Old 08-15-2007, 05:19 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You can configure sudo to use the users password. This is the way Fedora Core and other distro's do it by default. The passwd program is suid, and allows a user to change their own password. If you have a simple script that calls the passwd program and resets the password, you can edit sudo so that a member of a particular group and execute that script (and only that script) as root without a password. The /etc/sudoers file has a commented example for mounting cdroms. You could base your command on that. A script could take the username or uid as an argument.

Sudo is used to delegate certain tasks that require root access without sharing the root password. You don't want just any user to be able to reset another's password. That would allow them to reset someone else's password and then log in as that user.
 
Old 08-17-2007, 05:30 PM   #7
Julix
LQ Newbie
 
Registered: Aug 2007
Location: Argentina
Distribution: Debian Etch, Slackware 12
Posts: 28

Original Poster
Rep: Reputation: 15
Smile

Hi All,

thanks a lot for all your assistance. I like the idea of using a script for this and give sudo permission to it. I will try setup one and see if itīs working
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Resetting Windows Passwords with Knoppix halo14 Linux - Distributions 15 09-09-2013 01:39 AM
DISCUSSION: Resetting Windows Passwords with Knoppix halo14 LinuxAnswers Discussion 19 10-13-2007 01:25 PM
Root and General Users passwords jabos Mandriva 3 08-25-2007 09:01 PM
[SOLVED] samba resetting users connections to files New2Linux2 Linux - Server 33 02-22-2007 05:18 PM
Can root view other users' passwords? lasindi Linux - Security 4 06-27-2004 06:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:16 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