Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
There is less than 24 hours left to vote in the 2015 LinuxQuestions.org Members Choice Awards. Click here to go to the polls. Vote now and make sure your voice is heard!
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I want to show for each user that login through ssh an specific message, like a todo list for that specific user, I know that I can user /etc/motd or /etc/issue to display a message system wide but I don't know how to do the same only for an specific user...
can anyone help me on that?
In alternative to what suggested by tredegar (which is an excellent advice, anyway) you can create a directory under /etc containing custom welcome messages for each users and put the username in the name of each file. For example:
# ls /etc/welcome
welcome_colucix welcome_maginotjr welcome_tredegar
then in /etc/bashrc (or equivalent) add the following line at the end
test $TERM == xterm && cat /etc/welcome/welcome_$USER
in this way you can mantain your list of MOTD without writing in each user's home directory every time you have to change them.
One last point, make sure you put in some kind of check to see if the file exists before attempting to display it or your users will see errors (colucix did this with test, just make sure you include a similar mechanism.)
At the end of each user's ~/.bashrc file you could put cat ~/todolist
Putting this in a user's ~/.bashrc file will the output on every new instance of bash (including sudo bash) rather than just on connect. Using ~/.profile instead is a better option, if this is a desired approach (e.g. someone wants a nice msg when connection to a system on which they have no admin access).