I have my Jenkins installed on a windows server and I have created a Jenkins user on the server now I need to push the WAR files to my Linux server to a particular user root (myrootuser) who is there in the sudoers file.

I have access to this server also (myusername) in sudoers files, so I can login using my credentials and su sudo su - myrootuser to gain access.

My question
Can Jenkins user access myrootuser using without being in the sudoers file I tried adding the public key of Jenkns into myrootuser .ssh/ authorized_keys and i added a file know_hosts in the windows server with the Linux server details


I have a Linux server with Jenkins on it and that server talks to this Linux server perfectly fine... its public key is present in authorized_keys so I add my windows server key here... but it doesn't work

  • Sorry but it's not all clear to me. Are you trying copy war files from one server to another? Do you have any error message?
    – Daniel PC
    May 8, 2018 at 6:44
  • yes that's what I want to do using jenkins, Unfortunately jenkins throws an bad connection error... so I need the 2 servers to connect before actually trying to send the files over May 8, 2018 at 7:56

3 Answers 3


you can add access to the folder in linux using chown command where you can add user or group with recursive options, example : chown -R jenkins:root /folderpath also set proper read write permission using chmod or you can use setfacl command setfacl

  • I have a linux server with Jenkins on it and that server talks to this linux server perfectly fine...its public key is present in authorized_keys so I add my windows server key here... but it does'nt work May 8, 2018 at 10:46

Like Vijay said, create a shared folder:

mkdir /jenkins

Then create a group to allow the root user and jenkins to share access:

groupadd jenkins

And add the jenkins and root user to it:

usermod jenkins -G jenkins
usermod root -G jenkins

Last chown and chmod the directory to jenkins:

chown jenkins:jenkins /jenkins
chmod 770 /jenkins

Good luck!

  • Unfortunately it was more complex than that ... all the above conditions were meet already and it turns out, it required an additional IP address to be mentioned in the access.conf file May 17, 2018 at 3:50

So it turns out that the server accept only a particular IP address(other servers).How I found out the issue was by following the below steps:

Firstly, I viewed the issue on client side using -vv

ssh -vv prcsvc@d9t1050g.houston.hp.com

turns out there was no issue on the client side so I moved on to the server side.

To view issue on server side for ssh

vi /var/log/secure

Here i found out that my client server(IP address was being denied) and after some googling I found out that I had to modify the below file

sudo  vi /etc/security/access.conf

You will find the user followed by IP Address e.g myrootuser

Just add the new client server IP address and your good to go :)
P.S. you need root access or sudo to modify this file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.