transfer files between linux servers ssh without password in jenkins

14 views
Skip to first unread message

Sachin Chaudhary

unread,
Oct 4, 2018, 5:58:55 AM10/4/18
to jenkins...@googlegroups.com
Hi,

I am trying to copy the war file from jenkin server to application server and both are linux boxes.
I have tried lot of option like

Option one:
***********
sshpass -p password scp -o StrictHostKeyChecking=no /opt/comp/jetty/9.3.7.v20160115/etc/core/ pian...@testing.comp.com/opt/comp/jetty/9.3/resources/

Option two:
***********
scp file-to-copy.war  pian...@test1xyz.comp.com:/tmp/
sudo su –
mv /tmp/file-to-copy.war /opt/comp/jetty/9.3/webapps/

Both cases it says "Permsion denied" in jenkins. 

Does this scp command support without password Or any certificate or token need to be creared.

Can anyone have experience in transfering the files between two linux boxes without password?

Thanks,
Sachin

Ivan Fernandez Calvo

unread,
Oct 4, 2018, 12:50:55 PM10/4/18
to Jenkins Users
The error "Permission denied" is because the user  piansible does not have read/write permissions on the source/destination, check it this user can read the sources files and can write the destination folder. About to not use a password for login, the most common way to make it is by using SSH key authentication (see https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server
Reply all
Reply to author
Forward
0 new messages