Re: Non Interactive passwd change via script....

2007-04-04 Thread Agus

2007/4/3, Kevin Kinsey [EMAIL PROTECTED]:


Agus wrote:
 Hi everybody
 its been a few days now, since im trying to do a tcsh script to
automatize
 the process of creating users in my system
 Users register via web, and info is saved in a MySQL DB and in a
   file. the
 script reads from the file and begins adding users with pw.
 but im stuck on how to create the password for the users. the
 only solution
 that worked was the use of expect, but it consumes a lot of resources
 (7.8%System). Now that isnt a problem cause the users are few. but if
 it has to
 add a lot of users?? it will kill my server

 any hints will be apreciated.

 pw(8)  ??

 I cant find the way to do it with pw

 thanks

Please keep the list in the TO: or CC: field on your
replies ... thanks!

Works fine here as described in pw(8):

[EMAIL PROTECTED]
$ id test
id: test: no such user

[EMAIL PROTECTED]
$ pw useradd -n test

[EMAIL PROTECTED]
$ id test
uid=1020(test) gid=1026(test) groups=1026(test)

[EMAIL PROTECTED]
$ finger test
Login: test Name: User Test
Directory: /home/test   Shell: /bin/sh
Never logged in.
No Mail.
No Plan.

HTH,

Kevin Kinsey
--
It took me fifteen years to discover that I had no talent for writing,
but I couldn't give it up because by that time I was too famous.
-- Robert Benchley




OK..thanks for the heads up about responding

The problem isnt adding the useri ve done that..the problem is
creating the password for the user as i tried to say in the first email...

thanks kevin,
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Non Interactive passwd change via script....

2007-04-04 Thread Vince
Agus wrote:
snip

 
 
 OK..thanks for the heads up about responding
 
 The problem isnt adding the useri ve done that..the problem is
 creating the password for the user as i tried to say in the first email...
 
Assuming you dont mean actually generating the password maybe you need the
  -h fd
flag to pw
or more specificly (from the manpage)
 pw will prompt for the user's password if -h 0 is given,
 nominating stdin as the file descriptor on which to read
 the password.  Note that this password will be read only
 once and is intended for use by a script rather than for
 interactive use.

so something like
echo PASSWD | pw add user wibble -h 0
will create a user wibble with password of PASSWD

or
echo $PASSWORD | pw add user $USERNAME -h 0
setting $PASSWORD and $USERNAME as needed.

Vince



 thanks kevin,
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
 [EMAIL PROTECTED]

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Non Interactive passwd change via script....

2007-04-04 Thread Agus

2007/4/4, Vince [EMAIL PROTECTED]:


Agus wrote:
snip



 OK..thanks for the heads up about responding

 The problem isnt adding the useri ve done that..the problem is
 creating the password for the user as i tried to say in the first
email...

Assuming you dont mean actually generating the password maybe you need the
  -h fd
flag to pw
or more specificly (from the manpage)
pw will prompt for the user's password if -h 0 is given,
nominating stdin as the file descriptor on which to read
the password.  Note that this password will be read only
once and is intended for use by a script rather than for
interactive use.

so something like
echo PASSWD | pw add user wibble -h 0
will create a user wibble with password of PASSWD

or
echo $PASSWORD | pw add user $USERNAME -h 0
setting $PASSWORD and $USERNAME as needed.

Vince



 thanks kevin,
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
 [EMAIL PROTECTED]



Thanks Vince, that was exactly what i was looking for.i read the man
page and saw the -h or th -H ir it is encrypted.but i copuldnt make it
work, didnt know how
your example lightens up everythinggrea

thanks alot
i will try it as sonn as i get home...

thanksss
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Non Interactive passwd change via script....

2007-04-03 Thread Agus

Hi everybody
its been a few days now, since im trying to do a tcsh script to automatize
the process of creating users in my system
Users register via web, and info is saved in a MySQL DB and in a file. the
script reads from the file and begins adding users with pw.
but im stuck on how to create the password for the users. the only solution
that worked was the use of expect, but it consumes a lot of resources
(7.8%System). Now that isnt a problem cause the users are few. but if
it has to
add a lot of users?? it will kill my server

any hints will be apreciated.

thanks a lot...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Non Interactive passwd change via script....

2007-04-03 Thread Kevin Kinsey

Agus wrote:

Hi everybody
its been a few days now, since im trying to do a tcsh script to automatize
the process of creating users in my system
Users register via web, and info is saved in a MySQL DB and in a file. the
script reads from the file and begins adding users with pw.
but im stuck on how to create the password for the users. the only solution
that worked was the use of expect, but it consumes a lot of resources
(7.8%System). Now that isnt a problem cause the users are few. but if
it has to
add a lot of users?? it will kill my server

any hints will be apreciated.


pw(8)  ??


thanks a lot...


You're welcome ;-)

Kevin Kinsey
--
Good news from afar can bring you a welcome visitor.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Non Interactive passwd change via script....

2007-04-03 Thread Kevin Kinsey

Agus wrote:

Hi everybody
its been a few days now, since im trying to do a tcsh script to automatize
the process of creating users in my system
Users register via web, and info is saved in a MySQL DB and in a
  file. the
script reads from the file and begins adding users with pw.
but im stuck on how to create the password for the users. the
only solution
that worked was the use of expect, but it consumes a lot of resources
(7.8%System). Now that isnt a problem cause the users are few. but if
it has to
add a lot of users?? it will kill my server

any hints will be apreciated.



pw(8)  ??


I cant find the way to do it with pw

thanks


Please keep the list in the TO: or CC: field on your
replies ... thanks!

Works fine here as described in pw(8):

[EMAIL PROTECTED]
$ id test
id: test: no such user

[EMAIL PROTECTED]
$ pw useradd -n test

[EMAIL PROTECTED]
$ id test
uid=1020(test) gid=1026(test) groups=1026(test)

[EMAIL PROTECTED]
$ finger test
Login: test Name: User Test
Directory: /home/test   Shell: /bin/sh
Never logged in.
No Mail.
No Plan.

HTH,

Kevin Kinsey
--
It took me fifteen years to discover that I had no talent for writing,
but I couldn't give it up because by that time I was too famous.
-- Robert Benchley
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]