SSH Shell script help

From: Gowthaman N (n.gowthaman@gmail.com)
Date: Wed Jun 20 2007 - 08:43:52 EDT


Hi All,

I m writing a shell script to automate the configuration of password less
ssh logins between solaris servers

for a user id say xzy on either way (i.e) login without passwd from a->b and
b->a like that.

But my script does only the below things :

#!/usr/bin/bash

echo "To do passwdless login Port 22"
echo "First Time the userids would ask for passwds to create the public key"

if [ $# -le 0 ]; then
cmd=`basename $0`
echo . $cmd netid@server-ipaddress
exit 1
fi

remote=$1
if [ ! -f ~/.ssh/id_rsa.pub ]
then
echo " "
ssh-keygen -t rsa
fi
ssh $remote mkdir .ssh
chmod 0744 .ssh
scp .ssh/id_rsa.pub $remote:.ssh/authorized_keys

Can anyone provide me help in enhancing this.

Many Thanks

N. Gowthaman
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:42:04 EDT