ubuntu - Python sudo in new terminal window without passing password -


i have problem. i'm trying run sudo command in new terminal window python script every time have put password in new window. here code:

import subprocess import sys import os def run_lirc():     subprocess.call(['x-terminal-emulator','-e','sudo lircd']) run_lirc() 

is solution allow me not pass root password? have open lirc in new terminal window.

apart calling subcommand in "terminal window" being bad idea, issue sudo configuration.

sudo assigns tty cookies sessions, limiting session timeout tty got authentication.

you can prevent happening disabling tty_tickets option in /etc/sudoers:

defaults !tty_tickets 

Comments

Popular posts from this blog

javascript - IndexedDB error: Uncaught DataCloneError: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned -

java - Unable to make sub reports with Jasper -

Integrity error when loading fixtures for Selenium testing in Django -