expect라는 녀석으로 ssh 바로 접속가능
설치는 저번에 했고 이번에 직접 접속해봤는데
permission denied에러 뜨면
- have to change file mod
chmod 755 exp-file
아래는 예제인데 lindex 라인인덱스로 받아오는 게 중요함 전역 환경변수로 설정해두거나 여기서 환경변수 설정해서 프로젝트별 파일에 넣어두면 편할듯
- simple example
#!/usr/bin/expect set timeout -1 set target_host [lindex $argv 0] set password [lindex $argv 1] spawn bash -c "ssh $target_host" expect { "password: " { send "$password\r" } } interact
expect - 개인정리

Seonglae Cho