LinuxQuestions.org
Visit Jeremy's Blog.
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-06-2007, 12:54 AM   #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, 03:31 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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, 05:26 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

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



Cheers,
Tink
 
Old 07-06-2007, 11: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, 10: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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:14 PM
Force an application to run only for my user purefan General 1 04-12-2005 10:30 AM
I want to automatically run a program when a user logs on their account bad_andy Linux - Newbie 7 02-01-2005 09:55 PM
run program after user logs in kinasz Linux - General 2 09-22-2004 04:47 AM
Getting vncserver to run automatically when user logs in indespair Linux - Networking 2 10-26-2003 03:37 AM


All times are GMT -5. The time now is 07:07 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration