[ic] Encrypting password

Jon Jensen jon at endpoint.com
Wed Nov 24 11:50:49 EST 2004


On Wed, 24 Nov 2004, Davor Ocelic wrote:

> > Where 'new_password' corresponds to the new password you want and the 
> > other string is just a random string of junk. The output of this command 
> > can be put into the password field for a particular user record, and 
> > then that user can use "new_password". Of course, the new password is 
> > visible in the shell's command history, but for a temporary measure it's 
> > sometimes handy, particularly for admin access...
> 
> And to avoid having left anything in your shell history file 
> (the password or salt), you can use:
> 
> perl -e'print crypt(substr(<STDIN>,0,-1), join "", (".", "/", 0..9, "A".."Z", "a".."z")[rand 64,rand 64]'
> 
> (And then type in the password on next line.
> 
> Alternatively, you can exit the shell with 'kill -9 0' so it won't save
> the history.

Another option that won't leave anything in the shell history (and that
takes a lot less typing) is to use Apache's htpasswd command:

htpasswd -n foo

Jon


-- 
Jon Jensen
End Point Corporation
http://www.endpoint.com/
Software development with Interchange, Perl, PostgreSQL, Apache, Linux, ...


More information about the interchange-users mailing list