[NTLUG:Discuss] Add and modify users

Jonathan Miller betaray at kludge.org
Thu Mar 2 17:59:03 CST 2000


Well, if you want to be a big nerd you could put a .bashrc (su) and
.bash_profile (su -) (assuming you use bash for your root shell, if not
this message won't help at all, but then you've got bigger problems :)
that contains:

function passwd () {
    if [[ (`whoami` == 'root') && ($1 == '') ]];
    then
        echo "Don't Change the root password";
    else
        passwd $1;
    fi;            
}

then if you really want to change the password do /usr/bin/passwd or
passwd root. It doesn't prevent anyone smart from doing anything, but if
keeps mistkes from happening.

-- Jonathan

On Thu, 2 Mar 2000, Jay Urish wrote:

> I betcha sudo could be a solution for this..
> 
> the only problem i could see is that passwd is a stupid proggy. they could 
> still hose the root password..
> 
> Maybe what you need is a script that would ask for the username and then 
> feed that to passwd via sed or awk..
> 
> At 09:00 AM 3/2/00 , you wrote:
> >Is there a way to setup someone so they can add and modify users without
> >the root password.
> >
> >I work with idiots....and they keep trashing the root password, instead of
> >modifying their user password.
> >
> >
> >
> >
> >_______________________________________________
> >http://ntlug.org/mailman/listinfo/discuss
> 
> 
> Jay Urish
> Network Engineer - Dallas Wide Area Networking L.L.C
> www.dalwan.net
> 
> 
> _______________________________________________
> http://ntlug.org/mailman/listinfo/discuss
> 





More information about the Discuss mailing list