Frequent Question: What Scripts Are Set up to Run When a User Logs in Linux?
Contents

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.

Which file is run automatically when a user logs out?

When a user logs in or out, a script needs to be run automatically to notify a daemon process which user logged in or out. I searched in Google and found a script under /etc/profile. d will be run automatically after the user logs in.

How do I run a script after user login authentication in Linux?

For Linux Mint and Ubuntu with Desktop environment there is a option in main menu called “Startup Applications”, just go there and add the path to the script file. This script will run after login in window manager.

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest