# \[SOLVED\] How to update agent.jar on Windows agent?

**URL:** <https://community.jenkins.io/t/solved-how-to-update-agent-jar-on-windows-agent/5456>\
**Category:** Ask a question\
**Created:** [January 24, 2023, 7:21pm UTC](https://community.jenkins.io/t/solved-how-to-update-agent-jar-on-windows-agent/5456 "2023-01-24T19:21:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BriceCazaux](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@BriceCazaux](https://community.jenkins.io/u/BriceCazaux)\
**Post date:** [January 24, 2023, 7:21pm UTC](https://community.jenkins.io/t/solved-how-to-update-agent-jar-on-windows-agent/5456/1 "2023-01-24T19:21:30Z")

</div>

Hello,  
I have a Jenkins controller version 2.346.3 on RedHat 7  
I have several Windows agents which connect to it at launch. Their remoting version is 4.13.3.

When I upgrade my Jenkins controller, the agent.jar used by my Windows agents may be out of date, and I will have to upgrade the jar on every agent. (I had already to do this last time I upgraded my Jenkins controller)  
Is there a way to make Jenkins automatically update this jar at startup for instance ?  
Maybe if the Jenkins controller launches Windows agents itself via ssh ?

Thanks for your help 🙂

---

<div class="post-metadata">

**Author:** ![slide\_o\_mix](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/slide_o_mix/32/20977_2.png) [@slide\_o\_mix](https://community.jenkins.io/u/slide_o_mix)\
**Post date:** [January 24, 2023, 8:14pm UTC](https://community.jenkins.io/t/solved-how-to-update-agent-jar-on-windows-agent/5456/2 "2023-01-24T20:14:29Z")

</div>

How are you connecting your agents? Generally, I thought most connection methods update the agent.jar during the start up.

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [January 24, 2023, 8:53pm UTC](https://community.jenkins.io/t/solved-how-to-update-agent-jar-on-windows-agent/5456/3 "2023-01-24T20:53:33Z")

</div>

> [@BriceCazaux](#):
>
> Maybe if the Jenkins controller launches Windows agents itself via ssh ?

Yes, if you switch from inbound agents to ssh agents, the Jenkins controller will automatically update the agent.jar file.

Inbound agents are controlled by the operating system and the person who installed them. Outbound agents (like ssh) are managed by the Jenkins controller.

---

<div class="post-metadata">

**Author:** ![BriceCazaux](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@BriceCazaux](https://community.jenkins.io/u/BriceCazaux)\
**Post date:** [January 24, 2023, 9:52pm UTC](https://community.jenkins.io/t/solved-how-to-update-agent-jar-on-windows-agent/5456/4 "2023-01-24T21:52:57Z")

</div>

Thank you Mark for confirming that !  
I’m going to try it.

---

<div class="post-metadata">

**Author:** ![BriceCazaux](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@BriceCazaux](https://community.jenkins.io/u/BriceCazaux)\
**Post date:** [January 25, 2023, 3:32pm UTC](https://community.jenkins.io/t/solved-how-to-update-agent-jar-on-windows-agent/5456/5 "2023-01-25T15:32:41Z")

</div>

It worked !

I did the following actions (it may help other users) :

1. Install openSSH Server on the PC used for Windows agent
2. Start OpenSSH Server service
3. Configure PATH on Windows to match JDK 11
4. Create agent on my Jenkins controller with “Launch agent via SSH” method
5. Add the right credentials
6. Modify “Host Key Verification Strategy” to “Non verifying Verification Strategy” (I’m not concerned by security issues for now)
7. Modify “Prefix Start Agent Command” to add “cd /d D:\ &&”, because I wanted to run my agent on D:\ drive
8. Start agent

Now, my Windows agent is up and running. Jenkins controller has automatically uploaded a remoting.jar in version 4.13.3 (which was expected, because my controller is in version 2.346.3)
