many option about ssh command are not describe into man, and when you need to automatic some script, it could be usefull to bypath some ask from default ssh command

exemple : (more info into man ssh_config)

  • ConnectTimeout=xx is about to stop connection if no reply after x sec
  • PasswordAuthentication=yes|no   Dont ask password (default yes)
  • ChallengeResponseAuthentication=yes|no   (default yes)
  • BatchMode=yes|no  this disable passphrase / password ask , really usefull for scripting (default no)
  • StrictHostKeyChecking=yes|no|ask  (default ask) usefull to add automatically new server authkey into ~/.ssh/known_hosts whitout asking

a usefull ssh  command exemple :

LISTE_SERV=/Path_list

LOG_OUT=/PATH_log

# for i in `cat $LISTE_SERV` ; do ssh $i -o BatchMode=yes -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o ChallengeResponseAuthentication=no "command into ssh tunnel" >> $LOG_OUT ; done

 To copy ssh public key on remote server using SSH :

cat ~/.ssh/id_dsa.pub | ssh ${username}@${remote_server} "touch ~/.ssh/authorized_keys && cat - >> ~/.ssh/authorized_keys" ; exit 0


To get more options about scanning all your Unix-Linux information system you can use this script as below.