sshpass -p password ssh -T -oStrictHostKeyChecking=no user@somehost 

sshpass -f pass.txt ssh user@somehost


#!/bin/bash

PUBKEY=`cat ~/.ssh/id_dsa.pub`

for m in `cat hosts.txt`
do

[[ ${m:0:1} == "#" ]] && continue # skip if comment

echo $m =============================

sshpass -f pass.txt ssh -T -oStrictHostKeyChecking=no user@$m <<EOF1
if [ ! -e ".ssh" ]
then
    mkdir .ssh
    chmod 700 ~/.ssh
fi

umask 022
echo $PUBKEY >> .ssh/authorized_keys
EOF1

done


출처 : http://aero.sarang.net/blog/2009/01/ssh-1.html 

Posted by 뭉탁거림
,