Windows – publish over ssh jenkins

cygwinJenkinssshwindows

I have been working on a small project where need to copy files from one windows machine to another through jenkins in a secure way. I have heard about publish over ssh plugin in Jenkins. I tried to set that up but no luck. Did anybody do that and help me in that? Even to resolve it, i had installed openssh with cygwin on both the windows server and tried to copy the files (through SCP) or just connect both hosts (through ssh) in linux way through cygwin but always gets error of –

ssh 3612 tty_list::allocate_tty: No tty allocated or

scp 2680 tty_list::allocate_tty: No tty allocated

Please help!

Best Answer

do you have the "exec in pty" check box set in your jenkins job configuration for send over ssh?

Exec the command in a pseudo tty

This will enable the execution of sudo commands that require a tty (and possibly help in other scenarios too.) From the sudoers(5) man page:

requiretty If set, sudo will only run when the user is logged in to a real tty. When this flag is set, sudo can only be run from a login session and not via other means such as cron(8) or cgi-bin scripts. This flag is off by default.