Ssh login to remote windows server and run commands via gitlab-ci


Basically, I intend to copy my jar binary to my remote windows server and then execute some commands via ssh but unfortunately, I can not execute the commands on the remote server after copying my jar file to the remote server. below are examples of what I have tried

- sshpass -V
- sshpass -p “password” scp -o stricthostkeychecking=no target/spring-app-1.1.jar user@x.x.x.x:/Users/user/Documents/gitlab_ci/spring-app/
- sshpass -p “password” ssh -o stricthostkeychecking=no -t -t user@x.x.x.x “echo java -jar spring-app-1.1.jar > service.bat”

  • sshpass -V
  • sshpass -p “pass” ssh -t -t user@x.x.x.x -o remotecommand=“cd Documents/gitlab_ci/inlaks-gtb-cashout/ && echo ‘java -jar inlaks-gtb-cashout-service-1.1.jar’ > service.bat”