SSH Shell script help



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@xxxxxxxxxxxxxxx
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



Relevant Pages

  • SSH proxy
    ... I have a fbsd gateway at home through which I share our cable modem with my ... They have their own boxes on the lan and ssh to them from work. ... have made a shell script to automate this, and have set it as the default shell ...
    (FreeBSD-Security)
  • Re: shell and numbered file
    ... look further at any scripts which are launched. ... > (when running a command from a shell script, ... which scripts get started if you login and which are not user based ...
    (alt.os.linux.suse)
  • Re: SSH login automation, get stuck at the last step.
    ... The ssh server that I am copying the public key to is not a typical ... The user "root" to login this box can not access the ... puts stderr "EXP username requested and sent " ...
    (comp.lang.tcl)
  • SUMMARY: how to set correct path?
    ... ven if we login with ssh. ... For BASH login shell, place the system wide ENV variables, such as PATH, ... You can set Use_login in the sshd_config to yes and restart sshd. ...
    (SunManagers)
  • Re: ssh brute force attacks
    ... What you are most likely seeing are SSH worms on hacked PCs that scan ... -- use a separate username/password for SSH access, ... -- enforce more complex usernames & passwords for all users on the server ... Instead require the user to login as a non-root user first, ...
    (comp.os.linux.misc)