I'm running a Python script with Selenium to authenticate to a service that opens an app via deep linking. The script runs remotely with SSH using sudo, but since Selenium is running as sudo, the deep link fails to open the app. Without sudo, it works fine, but I need the script to run with sudo. Is there a way to run only Selenium as the user while the rest of the script runs with sudo? Continue reading...