[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: creating new users on debian



On Tue, 1 Feb 2005 11:02:35 +0100, Andreas Rippl <a.rippl@gmx.net> wrote:
> On Mon, Jan 31, 2005 at 03:46:40PM -0500, mack wrote:
> > I'm doing research on creating new users on a debian radius server
> > using a bash script.  I've been looking at adduser and useradd
> > commands today, but can't seem to figure out how to fit it together.
> > Adduser is an interactive command and for some reason the useradd
> > command doesn't seem to be creating users correctly in order to
> > authenticate.  I've read the man pages on these commands. Any help
> > would be appreciated.
> >
> > Thanks.
> >
> > mack
> >
> > 
> Hi Mack,
> 
> perhaps a stupid suggestion, but useradd with the -p option enters the
> unencrypted passwd into /etc/shadow, so authentification can't work.
> The passwd needs to be supplied to the -p option encrypted.
> A (non-interactive) way around is to not use -p option and to do
> a '/usr/bin/passwd $username' in a second step. There is also a
> Shadow-Password-HOWTO which might have some info on supplying encrypted
> passwds to -p.
> 
> Anyway, the README.Debian under /usr/share/doc/passwd says to use the
> adduser command...
> 
> Now, if you meant that user creation works and you only have problems
> with the radius configuration, ignore this drivel.
> 
> Hth,
> 
> Andreas
> 
 
Thank you for your advice and suggestions!!

I tried to command /usr/bin/passwd $USERNAME like you said, but at the
command prompt it then goes into interactive mode asking for the new
password.

Since I will need to run a non-interactive script to a remote machine
to set up new user accounts, anything that prompts the sysadmin is no
good.  We've got a lot of people creating new accounts from our  the
call center.  When the new accounts are created in the billing
software, it makes a remote connection to the radius server.  There
has to be a script on the radius server that can create a username and
password.

On an old RedHat machine the perl script the former admin used worked
fine.  But the version of passwd on Debian does not allow to use the
--stdin flag which is necessary for the script to run non-interactive.

I'm not a perl script writer (yet!), so I'm trying to write just a
simple bash script to do the same thing.

So my problem is how to get passwd to work without someone sitting
there typing in the user's new password.....

Thanks for any help!!!

mack

-- 
mackines@gmail.com



Reply to: