SSH自動登錄腳本


原創轉載請注明出處:https://www.cnblogs.com/agilestyle/p/11926792.html

 

vi app-stg.sh

1 #!/usr/bin/expect -f
2 #auto ssh login
3 set timeout 30
4 spawn ssh hatianqi@181.171.161.10
5 expect "password:"
6 send "12345678\r"
7 interact

wq后

1 chmod 744 app-stg.sh

cd到腳本所在的目錄,登錄

1 ./app-stg.sh

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM