LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-05-2007, 11:54 PM   #1
licht
Member
 
Registered: Mar 2005
Location: chicago
Distribution: red hat 9.0
Posts: 59

Rep: Reputation: 15
How to force sth to run when each user logs in?


For example, when a user login, write the current time to a file is his or her home folder. I think this can be some common login script so that when a new user is created, the command will be written to .bashrc or .profile or something. But how to achieve this? BTW, I am using opensuse. Thanks!
 
Old 07-06-2007, 02:31 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
look for /etc/bash_profile iirc.
This is run for every user when they login,before running user's own .bash_profile.
 
Old 07-06-2007, 04:26 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
That'll be /etc/profile ... unless your distro has hacked bash.



Cheers,
Tink
 
Old 07-06-2007, 10:38 AM   #4
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
To follow your idea of providing dot files for new users, put them in /etc/skel. However (a) this won't apply to existing users, and (b) the users are free to edit their dot file, so this may not meet your objective to force it.
 
Old 07-08-2007, 09:18 PM   #5
licht
Member
 
Registered: Mar 2005
Location: chicago
Distribution: red hat 9.0
Posts: 59

Original Poster
Rep: Reputation: 15
Thanks to all!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automaticly run script when user logs in? bigdog0007 Linux - Security 3 06-23-2005 03:14 PM
Force an application to run only for my user purefan General 1 04-12-2005 09:30 AM
I want to automatically run a program when a user logs on their account bad_andy Linux - Newbie 7 02-01-2005 08:55 PM
run program after user logs in kinasz Linux - General 2 09-22-2004 03:47 AM
Getting vncserver to run automatically when user logs in indespair Linux - Networking 2 10-26-2003 02:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration