Reputation: 343
When I use the following codes in terminal
, it works well.
#!/usr/bin/expect -f
spawn scp /Users/Shared/Jenkins/workspace/testslave/XXXXXX [email protected]:/tmp/XXXX
expect "*assword:"
send "password\r"
interact
but when I copy the content to the Jenkins
,the Jenkins didn't copy the file to the destination
,and with no error.
Upvotes: 1
Views: 2889
Reputation: 4995
A cleaner approach is to generate a public/private key with no pass-phrase and to use it as an authentication method.
The steps are:
scp -i id_rsa /Users/Shared/Jenkins/workspace/testslave/XXXXXX [email protected]:/tmp/XXXX
Upvotes: 1