Server Fault is a question and answer site for system and network administrators. 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 have a shell script that I want to be run each time a user logs on. I use Ubuntu as the OS. The script should be run after user logon in ubuntu.

Thanks for your help

share|improve this question
up vote 4 down vote accepted

In Ubuntu, any script ending in .sh that's placed in /etc/profile.d/ will be run whenever a user logs in. That's what lines 4-11 of /etc/profile do.

share|improve this answer

take a look at /etc/profile

share|improve this answer
Yes i have look at that, but i can't figure out where to put my shell script path so it should be run when user has logon to the computer. – Frozzare Oct 24 '09 at 23:12
all files in /etc/profile.d/ are executed automatically, you dont have to setup an specail script path (whatever this should be) – evildead Oct 25 '09 at 0:57

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.