반응형
증상
root에서는 실행가능, 사용자에서는 퍼미션에러
cd /home/사용자명 ; /usr/bin/env /bin/python3 /home/사용자명/.vscode-server/extensions/ms-python.python-2021.10.1365161279/pythonFiles/lib/python/debugpy/launcher 37148 -- /home/사용자명/TestSample/test.py
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/ping3/__init__.py", line 276, in ping
sock = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_ICMP)
File "/usr/lib64/python3.6/socket.py", line 144, in __init__
_socket.socket.__init__(self, family, type, proto, fileno)
PermissionError: [Errno 1] Operation not permitted
해결(shell)
sudo setcap cap_net_raw+ep $(readlink -f $(which python3))
'Linux > Python' 카테고리의 다른 글
simple python daemon (0) | 2021.11.01 |
---|---|
pid handle (0) | 2021.10.31 |
Python argument vscode debug (0) | 2021.10.30 |
Python을 이용한 RAID상태 모니터링 (0) | 2019.04.15 |