Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am setting up a machine that's sole purpose is to run a specific python application that uses a curses ui. That being said, there are some aspects of the application that require it to be run as su.

How can I run this application on login so the user doesn't need to execute it every time? I have seen Is there a script that runs as root when user logs in? and it seems different than mine as they don't actually require su there.

I really don't care about security at all for this application, it's not online nor will it ever be online. I don't even care if I have to enter my credentials twice either. I just want it to execute the line:

sudo python ~/Application/

on login. If there's a more efficient way where I don't have to enter credentials twice, that would be even better. This has to work on Ubuntu Server as well.

share|improve this question
up vote 0 down vote accepted

I found a solution through this stack overflow answer: which works for me. I just added

cd ~/Application
sudo python

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.