#!/bin/csh # # gripe-decrypt: Help with decrypting a GRIPE initial password # # Tell it your grid username and it looks for the password message # (file name .ssl) and decrypts it. # # Eric Myers - 15 August 2001 # @(#) $Id: gripe-decrypt,v 1.1 2001/08/16 17:22:56 myers Exp myers $ ###################################################################### # Add globus/ssl tools to path set path=( /usr/local/globus-install/tools/i686-pc-linux-gnu/bin $path ) set path=( /usr/local/ssl/bin $path ) # Where to search for the user's cert (likely places) set TMPDIRS=( /tmp /var/tmp /home/myers/tmp ) # Get user's name if ( $# > 0 ) then set USERNAME=$1 else echo -n "Enter the username: " set USERNAME=$< endif ## Find the password message set USERCERT=${USERNAME}.ssl foreach TDIR ( $TMPDIRS ) set MSGFILE=$TDIR/$USERCERT if ( -f $MSGFILE ) goto FOUND end echo -n "Enter filename of password message for $USERNAME: " set MSGFILE=$< if ( ! -f $MSGFILE ) then echo "Cannot find $MSGFILE" exit 2 endif FOUND: echo "##########################################" echo "Decrypting $MSGFILE :" echo " " openssl rsautl -in $MSGFILE -inkey ~/.globus/userkey.pem -decrypt if ( $status != 0 ) then echo "Problem decrypting. RC=$status" exit $status endif echo " " echo "##########################################" exit 0