I declare not so stupid unix tricks thread open
Pete Wright
pete at nomadlogic.org
Fri Mar 14 12:57:23 EDT 2014
On 03/14/14 08:29, Marc Spitzer wrote:
> We need to share our not so stupid unix tricks. Here is one:
>
> ssh key access audit script:
> for i in $(seq 254) ; do x="192.168.49.$i"; echo -n "$x: " ; ssh -o
> PasswordAuthentication=no -o NumberOfPasswordPrompts=0 $x hostname ;
>
> this will give you one of 3 things:
> 1: hostname
> 2: failed login
> 3: unreachable error
>
> Easy way to find out where your keys work, who's next?
here's a stupid bash aliases i use to print out all hosts in a given
DC/sub-domain:
function h() { host -la "$@".MY.DOMAIN \ DNS0."$@".MY.DOMAIN|grep
^f|awk -F" " '{print $1}' \
| sed -e 's/\.$//g' ;}
so if i want to see all my "web" nodes in my iad1 subdamon i'd run:
$ h iad | grep web
-pete
--
Pete Wright
pete at nomadlogic.org
twitter => @nomadlogicLA
More information about the talk
mailing list