LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-26-2007, 01:43 PM   #1
dellthinker
Member
 
Registered: Jan 2007
Distribution: Debian
Posts: 220

Rep: Reputation: 30
Printing custom motd


How would i setup my machine to print a welcome msg for individual users? Sort of like
user1 - Hello How Are You Today/
user2 - Hiya user2! How are things?

Is there a way to customize debian like this? Thanx in advance.
 
Old 01-26-2007, 02:13 PM   #2
MOS JEFF-INITELY
Member
 
Registered: Sep 2006
Distribution: Windows .. MUAHAHAHA
Posts: 66

Rep: Reputation: 15
add to your /HOME/username/.profile which is lauched everytime the login process is started.
 
Old 01-27-2007, 03:14 AM   #3
basileus
Member
 
Registered: Nov 2004
Location: Turku, Finland
Distribution: Debian, Ubuntu, Gentoo
Posts: 388

Rep: Reputation: 30
Or if you want to keep the _messages_ in one central place, say, /etc/mymotd, you could add the /home/user/.profile like this:

/etc/mymotd

and the create /etc/mymotd

MYUSER=$(whoami)

if [ $MYUSER == "joe" ]; then
echo "Message for Joe"
elif [ $MYUSER == "john" ];
echo "Message for John"
else
echo "Message for everybody else, if any"
fi

Then chmod 755 /etc/mymotd. NOTE: I did not test this but it should not have any typos in it
 
Old 02-05-2007, 02:41 PM   #4
PB0711
Member
 
Registered: Aug 2004
Location: London, UK
Distribution: Ubuntu 10.10, ubuntu 11.04, suse 9.2, OSX
Posts: 259

Rep: Reputation: 30
Umm Can I jump in on this and ask what if it's NIS. Then if the person logs into another computer you won't be able to use that motd. I'm not the top sys admin so I would have to log into each user throught "su" -> "su user" and change the .bash_profiles, right?
 
Old 02-05-2007, 03:34 PM   #5
MOS JEFF-INITELY
Member
 
Registered: Sep 2006
Distribution: Windows .. MUAHAHAHA
Posts: 66

Rep: Reputation: 15
yea an NIS would be a problem with this method since they all have different profile files (.login, .cshrc, .profile, tcshrc, .kshrc or bashrc., ... [ although I think .profile works across the most shells]), I'm not sure how you could get around this without adding the message to each file .. this could be more than annoying and fairly time consuming.

as for changing the profiles themselves, yea if you dont have root you will need to either switch user or change the write permissions.

If any one has a way around the NIS I would like to know myself.

Thanks.
 
  


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
Custom kernel image on custom slack build using CUSS nykey Slackware 2 07-15-2006 03:05 AM
motd toothe Linux - Newbie 2 11-08-2005 04:02 PM
custom geforce video card--custom module? bandofmercy Linux - Hardware 3 10-14-2004 06:52 PM
motd Master Fox Linux - Software 2 08-25-2004 07:40 AM
Is there any MOTD software available besides /etc/motd? csif Linux - Software 1 04-24-2004 06:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:50 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