1. 程式人生 > >shell中scp自動輸入密碼

shell中scp自動輸入密碼

shell

```
#!/bin/bash
des_pass=testtest
expect -c "
spawn scp target/aaa-0.0.1.war [email protected]:/home/GameUser/MagicvesselUserWeb/aaa-release.war

expect \"password:\"
send \"${des_pass}\r\"
expect eof
"


本文出自 “不拋棄!不放棄” 博客,請務必保留此出處http://thedream.blog.51cto.com/6427769/1939658

shell中scp自動輸入密碼