I am not able to copy files through SCP command from my local machine where Jenkins is running to remote ubantu server. I have created a simple Build Step with Execute Windows batch command. Below is the command
I have configured SSH key on remote server correctly and if I run the above command separately on Windows Command Prompt it is copying the file successfully where as on Jenkins it is not showing any error just keep on running.
Tomcat - 9.0.73
Jenkins - 2.387.2 (deployes as war file on tomcat server)
Java - OpenJDK17U-jre_x64_windows_hotspot_17.0.6_10
Hi Alex, Thaks for the reply.
My windows user id, Jenkins user id and remote server (ubantu) user id all three are same only.
There should not be any issue with host key as the same batch file if I run through command prompt is working fine.
The problem is like it is not giving any error just keep on running. So I am not able to figure it out what is the root cause.
When i run through command prompt it does not require a password as SSH keys are setup correctly.
When I run through Jenkins build it is not asking any password but keep on running not giving even any error.
Please see the attached screenshot.
that sounds like different users. One user might have different envionment or home directories set.
I would recommend running a tool to export your environmental variables (set in windows, export in linux) in both your job and your “command prompt” to see whats different. I would bet its different users and thus different home directories, and thus different places for ssh keys to be installed.