Date: Fri, 16 Jun 2000 14:40:22 -0700 From: Frankie Li <notme@lvdi.net> To: Gabriel Ambuehl <gabriel_ambuehl-fbquestions@buz.ch> Cc: freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: How can I have pw to either generate random passwords or let me define them through CLI? Message-ID: <394A9EC6.92EA0C0C@lvdi.net> References: <539645219.20000616204253@buz.ch>
next in thread | previous in thread | raw e-mail | index | archive | help
I have found a way (although I'm not sure if this is the best and most secured way) to have the password supplied from command line. (and even from a text file, but I don't think that's too secured though) Although the man page states that a file descriptor is needed, all I did was just open an empty file, and use it as a file descriptor. However, I am not sure if there is any side effect. here's an example touch tempfile (the following should be one line, but it couldn't fit within 70 characters.) echo password | pw useradd someuser -d /usr/home/cs1p1/someuser -e 6/30/2000 -m -g cs1p1 -h tempfile password contains your password, possibly from command line or from a file read by a shell script, and someuser is the username. cs1p1 is just a group that I use for school. -h seems to allow me to use an empty file as a file descriptor, and afterward, nothing is written in it. Well, it works ;) I believe -w random will generate a random password, but it prints passwords out in stdout, and I have no experience with it. I hope this helps. Frankie Gabriel Ambuehl wrote: > > Hello, > I'm trying to use pw in an account setup script but I've got a problem > with it, it doesn't seem to accept neither commandline supplied > passwords nor the random generation of those. The man page states that > there's a filedescriptor interface but I'd prefer to not mess with > that stuff if possible in anyway. Any ideas would be greatly > appreciated. > > Best regards, > Gabriel > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?394A9EC6.92EA0C0C>