sudo

Python EXE to request sudo access

岁酱吖の 提交于 2020-07-23 06:32:08
问题 I am working on a script to monitor my outgoing website connections. As an example, if I connect to reddit, I'd like the IP address of Reddit to be logged. I have this functionality down just fine, but in the future, I'd like someone else to be able to run my Python code as an EXE file. However, my script currently requires you to run as Sudo since it is sniffing the IP addresses. I'd like non-technical users to be able to use my app by simply clicking an EXE or entering their password if

Python EXE to request sudo access

老子叫甜甜 提交于 2020-07-23 06:31:25
问题 I am working on a script to monitor my outgoing website connections. As an example, if I connect to reddit, I'd like the IP address of Reddit to be logged. I have this functionality down just fine, but in the future, I'd like someone else to be able to run my Python code as an EXE file. However, my script currently requires you to run as Sudo since it is sniffing the IP addresses. I'd like non-technical users to be able to use my app by simply clicking an EXE or entering their password if

Python EXE to request sudo access

只谈情不闲聊 提交于 2020-07-23 06:30:08
问题 I am working on a script to monitor my outgoing website connections. As an example, if I connect to reddit, I'd like the IP address of Reddit to be logged. I have this functionality down just fine, but in the future, I'd like someone else to be able to run my Python code as an EXE file. However, my script currently requires you to run as Sudo since it is sniffing the IP addresses. I'd like non-technical users to be able to use my app by simply clicking an EXE or entering their password if

Why is the PYTHONPATH different when running Python with and without sudo?

好久不见. 提交于 2020-06-27 14:45:07
问题 There's something wrong with my OSX system and python that no amount of googling has fixed. I've uninstalled all traces of python except the system python package with OSX that I'm not supposed to uninstall, and then started afresh with a new python from python.org, and installed pip. Now...not sure if this particular behavior below is part of the issue, but it seems strange to me: I ran python twice. Once with sudo and once without. Without sudo, I can't access pip. What's going on? $ sudo

Why is the PYTHONPATH different when running Python with and without sudo?

风格不统一 提交于 2020-06-27 14:44:30
问题 There's something wrong with my OSX system and python that no amount of googling has fixed. I've uninstalled all traces of python except the system python package with OSX that I'm not supposed to uninstall, and then started afresh with a new python from python.org, and installed pip. Now...not sure if this particular behavior below is part of the issue, but it seems strange to me: I ran python twice. Once with sudo and once without. Without sudo, I can't access pip. What's going on? $ sudo

Ansible 2.1.0 using become/become_user fails to set permissions on temp file

雨燕双飞 提交于 2020-06-24 05:43:12
问题 I have an ansible 2.1.0 on my server, where I do deployment via vagrant and on PC too. The role "deploy" have : - name: upload code become: true become_user: www-data git: repo=git@bitbucket.org:****.git dest=/var/www/main key_file=/var/www/.ssh/id_rsa accept_hostkey=true update=yes force=yes register: fresh_code notify: restart php-fpm tags: fresh_code In this case with ansible 2.1.0 I get an error: fatal: [default]: FAILED! => {"failed": true, "msg": "Failed to set permissions on the

Ansible 2.1.0 using become/become_user fails to set permissions on temp file

时光总嘲笑我的痴心妄想 提交于 2020-06-24 05:43:11
问题 I have an ansible 2.1.0 on my server, where I do deployment via vagrant and on PC too. The role "deploy" have : - name: upload code become: true become_user: www-data git: repo=git@bitbucket.org:****.git dest=/var/www/main key_file=/var/www/.ssh/id_rsa accept_hostkey=true update=yes force=yes register: fresh_code notify: restart php-fpm tags: fresh_code In this case with ansible 2.1.0 I get an error: fatal: [default]: FAILED! => {"failed": true, "msg": "Failed to set permissions on the

Cannot run Python script using sudo

こ雲淡風輕ζ 提交于 2020-06-08 11:25:15
问题 I have a simple script which is using signalr-client-py as an external module. from requests import Session from signalr import Connection import threading When I try to run my script using the sudo python myScriptName.py I get an error: Traceback (most recent call last): File "buttonEventDetectSample.py", line 3, in <module> from signalrManager import * File "/home/pi/Desktop/GitRepo/DiatAssign/Main/signalrManager.py", line 2, in <module> from signalr import Connection ImportError: No module

How to run Anaconda Python on sudo

半城伤御伤魂 提交于 2020-05-14 09:43:23
问题 Currently using AWS to run some tests on a machine learning project. I would like to run Python scripts without internet (via root) because the internet bandwidth is extremely limited. I try to run the convnets.py script by doing sudo python convnets.py >> output But that does not work, as Anaconda does not use PYTHONPATH, making it impossible for root to find the Anaconda Python environment. So errors like "cannot import" and "module not found" are thrown. How do I set this up so I can get

JAVA_HOME not found as Sudo

删除回忆录丶 提交于 2020-04-29 09:13:15
问题 I have a bash script on a Linux box that runs a Jar file. When logged in as a regular user I don't have permission to run the script, but it prints the following log: *INFO * Using JVM found at /opt/jdk6/bin/java When I try to use the script with Sudo though, it gives: *ERROR* Unable to locate java, please make sure java is installed and JAVA_HOME set I've set JAVA_HOME to the same path above — can see it with echo $JAVA_HOME & it's also set as an option within the script. I'm happy that the