I have Jenkins 1.6 running on CentOS 7.2. I have Windows 2012 servers that I want to receive builds from the Jenkins server. These Windows servers are not on a domain. They have OpenSSH installed on them. On the Jenkins server, I manually created this path (from the Linux console): /home/jenkins/.ssh/
I gave the .ssh folder fully open privileges. I then ran a Jenkins job to happen solely on the Linux server itself. It was an Execute Shell job with these commands:
cd /tmp/
ssh-keygen -t rsa -N "" -f great.key
mv great.key.pub /home/jenkins/.ssh/
mv great.key /home/jenkins/.ssh
The commands should generate an SSH key pair for the Jenkins user. I do not know how to log into the Linux server with the Jenkins user. So I came up with the above.
I then manually made the permissions of the .ssh directory to be 600. I copied the contents of the .pub file into the authorized_keys file on the Windows server, specifically the file in C:\Users\jenkins.ssh\
Both the authorized_keys file and .ssh folder on the Windows server have security permissions wherein only the administrators group has full control of the file and and folder respectively. Then I ran a Jenkins build that was an Execute Shell script. Here are the three lines:
ssh -t -t jenkins@x.x.x.x
echo "something" > foo.txt
exit
I get this in the console output:
... Permission denied, please try again. ... Build step 'Execute shell' marked build as failure ...
How do I get Jenkins running on Linux to communicate with Windows servers? I would rather not install Cygwin on the Windows servers. There are license issues. It takes time to do that, and I think it is unnecessary.