
슈퍼유저 전체를 검색했지만 해결책을 찾을 수 없습니다. 다음은 ssh를 사용하는 스크립트입니다 expect
. 저는 우분투를 사용하고 있으며 aptitude install expect
.
#!/usr/bin/expect -f
spawn ssh user@server
expect "Password:"
send "mypassword\r"
interact
이 스크립트 파일 sh script.sh를 실행하면 다음 오류가 발생합니다.
test.sh: 3: spawn: not found
couldn't read file "Password:": no such file or directory
test.sh: 5: send: not found
test.sh: 6: interact: not found
이 게시물을 사용해 보았으나 작동하지 않았습니다. 비밀번호를 입력하지 않고 SSH를 사용하는 Ubuntu 10.04
감사해요,
답변1
파일을 실행 가능하게 만들어야 합니다.
chmod +x script.sh
다음과 같이 실행하세요.
./script.sh