YJWANG

[bash] expect 사용해서 interactive 자동화하기 본문

00.OS

[bash] expect 사용해서 interactive 자동화하기

왕영주 2021. 7. 23. 16:08

아래와 같이 진행하면 expect 명령을 이용하여 ssh-copy-id를 자동화할 수 있습니다.

#! /usr/bin/expect
# apt install expect

spawn ssh-copy-id -o "StrictHostKeyChecking=no" 10.99.99.90
expect "password:"
send "testtest\n"
expect eof
반응형