When I use this library by SSH works perfectly. Then I write a program and try to run it from Debian desktop and nothing happens. What can be wrong? Is the same program that runs via ssh, and now, it doesn’t work on debian desktop terminal
Any help will be appreciated in advance
When you run it via ssh, are you a "root" user?
Yes, I access as root user.
Well as "desktop" user you are "debian"...
oh… I see. I’m not very good in using linux. Is there anyway to access as root in desktop
It's not particularly easy, I've been moaning about this for a while,
it should be possible to to basic stuff like this as a non-root user.
I've have a (rather kludgy) workaround.
1 - Edit the sudoers file so that the user you want to be able to run
the Python script that uses the Adafruit IO libraries can 'sudo
/usr/bin/python' without entering a password.
2 - Change the shebang on your Python script to '#!/usr/bin/sudo
The user will then switch to root privilege to run the Python
interpreter which runs the script.
It's a nasty kludge and introduces security holes galore but it does
make it possible to pretend that everythng can be done in ordinary
(If you need more detail on how to do this I'm happy to provide it but
the sudo/sudoers man page should get you on your way)
Well it worked perfectly fine by just writing sudo python program.py
Thanks for all your help. I didn’t realise of this before and this was a big problem for my project.
Of course, by default the debian user can 'sudo' without a password,
I'd forgotten that. I've turned it off on my BBB.