# Remote ssh command fails on pynq

**URL:** <https://discuss.pynq.io/t/remote-ssh-command-fails-on-pynq/6168>\
**Category:** Support\
**Created:** [October 10, 2023, 12:32pm UTC](https://discuss.pynq.io/t/remote-ssh-command-fails-on-pynq/6168 "2023-10-10T12:32:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anrusal](https://avatars.discourse-cdn.com/v4/letter/a/c57346/32.png) [@anrusal](https://discuss.pynq.io/u/anrusal)\
**Post date:** [October 10, 2023, 12:32pm UTC](https://discuss.pynq.io/t/remote-ssh-command-fails-on-pynq/6168/1 "2023-10-10T12:32:46Z")

</div>

Hi all,  
I’m trying to execute a script located on my Pynq configured FPGA from a remote machine through ssh and I facing some issues.  
My setup looks as below:

- ZCU-104 FPGA with Pynq 3.0
- SSH configured to accept root ssh connections
- script named test.sh in which I basically load a bitstream
- remote windows OS machine in which I execute remotelly a ssh command to my pynq fpga

The script fails all the times loading the bitstream. I was initially thinking than that would be happening because lack of root privileges but I am starting to think than that could be somehow related with pl\_server service not running during ssh session.  
I was wondering if anybody could help me to get to the bottom of this.  
Best regards, Toni

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [October 10, 2023, 12:36pm UTC](https://discuss.pynq.io/t/remote-ssh-command-fails-on-pynq/6168/2 "2023-10-10T12:36:55Z")

</div>

Hi @anrusal,

Can you download the overlay from JupyterLab?

Are you sourcing the venv?

> [@Pynq z2: no module named pynq](https://discuss.pynq.io/t/pynq-z2-no-module-named-pynq/5674/2):
>
> PYNQ is installed in a virtual environment. To run a Python script you need to source the virtual environment first: source /etc/profile.d/pynq\_venv.sh Cathal

Mario

---

<div class="post-metadata">

**Author:** ![anrusal](https://avatars.discourse-cdn.com/v4/letter/a/c57346/32.png) [@anrusal](https://discuss.pynq.io/u/anrusal)\
**Post date:** [October 10, 2023, 12:51pm UTC](https://discuss.pynq.io/t/remote-ssh-command-fails-on-pynq/6168/3 "2023-10-10T12:51:43Z")

</div>

Hi @marioruiz ,  
thanks for your fast response. I am sourcing venv before running the script.  
When I connect to the FPGA with putty as root I am capable to run the script with no issues.  
Please have a look of my script below, you migh spot something hopefully.

test.sh script:  
source /usr/local/share/pynq-venv/bin/activate  
python /home/xilinx/conf\_fpga.py

In the other hand the conf\_fpga.py script is just as simple as this:

from pynq import Overlay  
ol = Overlay( “/home/xilinx/fpga.bit”)

Regards, Toni

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [October 10, 2023, 1:04pm UTC](https://discuss.pynq.io/t/remote-ssh-command-fails-on-pynq/6168/4 "2023-10-10T13:04:15Z")

</div>

PYNQ needs to be run as root, to download an overlay and also to interact with the overlay.

---

<div class="post-metadata">

**Author:** ![anrusal](https://avatars.discourse-cdn.com/v4/letter/a/c57346/32.png) [@anrusal](https://discuss.pynq.io/u/anrusal)\
**Post date:** [October 10, 2023, 1:20pm UTC](https://discuss.pynq.io/t/remote-ssh-command-fails-on-pynq/6168/5 "2023-10-10T13:20:47Z")

</div>

This actually being done.  
When I execute it through ssh remote command I actually do

“ssh root@pynq-ip -pw xilinx /home/xilinx/test.sh”

Since I am loging as root I don’t see why it doesn’t works.
