Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- hardening
- ansible
- ELASTIC
- proxycfg
- Kibana server is not ready yet
- Elasticsearch
- freebsd
- Proxy
- GitLab
- 보안양파
- XCP-ng
- bash
- xe guest utilities
- miniconda
- Windows
- centos 8
- macos
- ssh key 배포
- pfsense
- PlayBook
- 로그인불가
- elastic stack
- endpoint security
- G-suite
- x-pack
- docker
- 한글가이드
- Kibana
- application security
Archives
- Today
- Total
선 밖에 선 자유인
SSH login 테스트 본문
여러 대의 서버들에 ssh 로그인 가능한지 확인
-----------------------------------------------------------------
#!/bin/bash
HOSTFILE="host.txt"
stty -echo
read -p "Enter Password : " PASS; echo
stty echo
if [ -f ssh-check.txt ]; then
rm -f ssh-check.txt
fi
touch ssh-check.txt
# SSH 로그인 테스트
for ipaddr in `cat $HOSTFILE`
do
sshpass -p $PASS ssh -tt -o StrictHostKeyChecking=no <user>@$ipaddr "exit" 2> /dev/null
CHK=$?
if [ $CHK -eq 0 ]; then
echo $ipaddr : SUCCESS >> ssh-check.txt
else
echo $ipaddr : FAILED >> ssh-check.txt
fi
done
-----------------------------------------------------------------
Comments