0

I am designing a .bat file that uses Plink to execute python files located on a Raspberry Pi. Ideally a user will click on this bat file to execute python code on the Raspberry Pi without having to do anything else. I think the Raspberry Pi is operating on Raspbian. but I'm not 100% sure. This Raspberry Pi has a particular python interpreter on it that I want my .py files to be executed by, which is located at /usr/local/lib/python3.6.

I've had multiple errors, which I've troubleshot, but now I am finding that when I run a bat file containing:

plink -ssh root@169.254.32.236 -v su root -s /usr/local/lib/python3.6 helloworld.py

I receive the log:

Looking up host "169.254.32.236" for SSH connection
Connecting to 169.254.32.236 port 22
We claim version: SSH-2.0-PuTTY_Release_0.71
Remote version: SSH-2.0-dropbear_2017.75
Using SSH protocol version 2
No GSSAPI security context available
Doing ECDH key exchange with curve Curve25519 and hash SHA-256 (unaccelerated)
Server also has ssh-dss/ssh-rsa host keys, but we don't know any of them
Host key fingerprint is:
ecdsa-sha2-nistp521 521 ef:80:79:98:79:dd:b1:8e:62:14:f7:8d:30:71:5f:27
Initialised AES-256 SDCTR (AES-NI accelerated) outbound encryption
Initialised HMAC-SHA-256 (unaccelerated) outbound MAC algorithm
Initialised AES-256 SDCTR (AES-NI accelerated) inbound encryption
Initialised HMAC-SHA-256 (unaccelerated) inbound MAC algorithm
Using username "root".
Access granted
Access granted. Press Return to begin session.
Opening main session channel
Opened main channel
Started a shell/command
sSession sent command exit status 1
Main session channel closed
u: can't execute '/usr/local/lib/python3.6': Permission denied
All channels closed

Which is much more promising than the normal laundry list of errors I've seen in my code.

I understand that this is most likely a permissions issue, but I haven't gotten any further after using "chmod -x" on the .py file. This is the last hurdle and I'm itching to get this leg of the project finished! If you have any advise - or even ideas on how to go about this project easier- let me know!

(I'm also aware that using root is bad practice, I'm just desperate and stupid).

Thanks!

  • 169.254.32.236 is a Link-local address No version of Raspbian has used python3.6, and doesn't have a root account - which would normally be blocked by ssh – Milliways Jul 4 at 0:37

Your Answer

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

Browse other questions tagged or ask your own question.