1. sshpass 설치

# yum install sshpass

 

2. ssh key 생성

# ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N ""

 

3. hosts 파일 등록

 

4. ssh 설정변경

cat << EOF > /root/.ssh/config

Host *

  StrictHostKeyChecking no

  UserKnownHostsFile /dev/null

EOF

 

5. 20.21 대역 서버에 키 복사

# cat /etc/hosts | grep 20.21 | grep -v deploy | awk '{print "sshpass -p root ssh-copy-id "$1 }' | sh

+ Recent posts