---Xjack.org--- --


pwcrypt (formerly Cli-Crypt) version 1.2

The program pwcrypt is a very small, easy to use program, that will accept a password on the command line, and return the crypt()'ed form of the password.

Example usage:

bash# pwcrypt -h
crypt v 1.2.1 - copyright 2000 A.L.Lambert

Usage: crypt [-mhVqd] [-s salt] password_to_crypt
 -m = Employ MD5 encryption.
 -q = Quiet mode - for use with 'cleartext | crypt'.
 -h = This help message.
 -V = Print version info and exit.
 -s salt = Specify the salt to use

NOTE: Thanks to Joachim Fenkes for contributing code to provide MD5 support, which in turn inspired me to give this program the much needed facelift evident in version 1.2.x.

If you do not supply a password on the command line, you will be prompted for one (unless in quiet mode). All screen output is always done to stderr, allowing you to do things like
'pwcrypt > somefile',
whereby you will be prompted for the password, but all output will be redirected to somefile.

Use in shell scripts like this exmple of a proftpd-adduser script, for adding user accounts to a proftpd installation that uses a separate password file, to allow for a single system UID for ftp logins (note: this script contains little to no error-checking, but is entirely functional).

#!/bin/sh

# Set our variables for later use
UID=905 	# universal UID
GID=905		# universal GID
UNAME=$1	# new username
PASSWD=$2	# new password
HOMEDIR=$3	# path to homedir
COMMENT=$4	# comment
SHELL=/bin/false

# Make sure at least username/pass/homedir was given on the comman line
if [ "$1" = "" -o "$2" = "" -o "$3" = "" ] ; then
echo "Usage: proftpd-adduser username password homedir comment"
exit 1
fi

# Add this user to our /etc/proftpd-passwd file
echo "$USERNAME:`pwcrypt -m $PASSWORD`:$UID:$GID:$COMMENT:$HOMEDIR:$SHELL" >> /etc/proftpd-passwd

You can also use this software for any other similar uses, or possibly some use the authors havent even thought up yet. :)

Platforms:

This software should compile on any operating system with a libcrypt, libc, and a C compiler.

Downloads:

Number of recent downloads: 0



( Copyright 2001-2002 A.L.Lambert <al@xjack.org>, all rights reserved. )