3
내가 사용 gist.github.com 내부에 배치 bash는 스크립트를 실행할 수 있습니다 알고에있는 스크립트를 기대?실행은 다음과 gist.github.com
https://gist.github.com/simkimsia/5126919
#!/usr/bin/expect -f
set CHANGESHELL_FOR_USER [lindex $argv 0];
set PASSWORD_OF_USER [lindex $argv 1];
########################################
## switch to another user
## read this http://stackoverflow.com/a/1988255/80353
########################################
sudo -u $CHANGESHELL_FOR_USER -H sh -c "chsh -s /bin/bash"
expect "*?assword:*" {send -- "$PASSWORD_OF_USER\r";}
expect eof
내 목적은 특정 사용자에 대한 chsh 명령하는 것입니다
는 여기 샘플을 가지고있다. 이 같은 시도 할 수 있도록