samedi 18 octobre 2014

Require help interpreting bash program


Vote count:

0





#!/bin/bash
USER=root
KEY=~/.ssh/id_rsa.pub
for HOST in server1 server2
do
ssh -l $USER -i $KEY $HOST grep -I "Invalid user" /var/log/secure | awk '{ print $10 }'
done


I understand the grep.. line returns the IP addresses of "invalid user" attempts, but can anyone clarify the for HOST .. line? I'm not understanding what exactly this script does. Also when I put server1=workshop2 (my hostname) I receive the error ssh: cannot resolve hostname workshop2



asked 52 secs ago







Require help interpreting bash program

Aucun commentaire:

Enregistrer un commentaire