LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Run python programs without sudo in Debian wheezy (https://www.linuxquestions.org/questions/programming-9/run-python-programs-without-sudo-in-debian-wheezy-4175504653/)

psloss 05-11-2014 04:22 PM

Run python programs without sudo in Debian wheezy
 
How can I type 'python pgmname.py' rather than 'sudo python pgmname.py' and have the program run. The program uses a GPIO serial port on a Beaglebone Black. I am running as an administrator, not as root.
Thanks.

NevemTeve 05-12-2014 04:04 AM

Try this:
Code:

python pgmname.py

dwhitney67 05-12-2014 06:33 AM

Quote:

Originally Posted by psloss (Post 5168960)
How can I type 'python pgmname.py' rather than 'sudo python pgmname.py' and have the program run. The program uses a GPIO serial port on a Beaglebone Black. I am running as an administrator, not as root.
Thanks.

Which user/group owns the serial port device, as defined in /dev?

You may want to see if it is possible to assign your regular user account to be part of the group associated with the device.

If the group is root, then create a new group (e.g. gpio). Then assign your regular user to this new group, and finally change the group ownership of the device to the new group.

For example:
Code:

# Use at your own risk (as root or sudo)

$ sudo groupadd gpio

$ sudo usermod -a -G gpio <user>

$ sudo chown :gpio /dev/<devname>



All times are GMT -5. The time now is 08:41 AM.