Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
Code:
# ls /etc/welcome
welcome_colucix welcome_maginotjr welcome_tredegar
then in /etc/bashrc (or equivalent) add the following line at the end
Code:
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.)
Hey guys, do you know how to avoid printing the motd banner after successfull ftp login?
Thanks,
Sebas
That would depend on what ftp server you're using. Some don't print the motd banner at all and some use a special banner in the ftp root or a different file entirely.
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.