how can i restrict /etc/motd for a specific user
when i kept a message in /etc/motd all the users are getting whenever the users logged in. but can any body say how to restrict the message for a specific users and not for all
|
A sincere piece of advice ....
Looks like this is the 3rd post on the same question. Don't post so many posts regarding the same topic. One post will do. It is irritating to see so many posts on same topic / same question Posting several posts will not help you get more replies. http://www.linuxquestions.org/rules.php Plz refer to this also for more details |
The best choice for getting a specific message to a user is email
but if you want to have a message sent to a user on login you you could edit the global shell start up files in /etc with a little bit of shell wizardry to give them notice. Be warned if their home script has a simple clear command in it or they have fortune output something large or anything like that your message will be lost. In bash it would probably be something like if [ -e /path/to/msgs/${LOGNAME} ] ; then cat /path/to/msgs/${LOGNAME} rm /path/to/msgs/${LOGNAME} fi You would need to be careful with permissions to avoid users reading/writing/removing each others messsages. Good luck. |
hello Mr SATAN, thanks for ur sincere advice. I didn't get the correct reply. thats why i am posting several times
if i am troublig u. forgive me |
If you do not get the right reply, IMHO you should comment on that in the same thread. Maybe your question was not clear to the person who replied. Posting another is quite annoying for people who are trying to help you.
|
Satan & Hko -
Consider this: you should simply report the thread if it bothers you. Mods can clobber/move a thread. Mods can remonstrate. You posts didn't help the problem at all, IMO. One "corrective" post is more than enough. Also - mtest's English writing skills are probably why he doesn't get the answer he needs, because he has trouble phrasing it so we get it. I, for one, do not really know what he's trying to do. It looks like there is one user, X, who is not supposed to execute some common file or files at login. A solution would be to use the system-wide login script (on this box it's /etc/profile ) and do everything inside there. But since there is so little detailed information, I can't answer constructively. I made one guess bad earlier. |
I was bored at work and I just happen to have the sources for util-linux
kicking around on my harddrive so whipped up this little patch. I've been meaning to take a closer look at the sources to getty for a project I'm doing and since login is closely related I figured it'd be worth the sojourn. Theory of operation: You place a a list of names (1 per line) in /etc/motd.allow Only those users in this list will receive the motd. #include <stddisclaimer.h> I didn't try it out as I have no interest in changing the behavior of login (I also think it's silly thing to do) and I'm using my computer over ssh but if you actually have a desire to do so here it is. I also wouldn't trust the security on this thing as it's only lowly me cranking out this patch and it hasn't been exposed to any peer review. Anyways here's the diff for it: Code:
--- util-linux-2.12/login-utils/login.c 2003-07-13 14:11:31.000000000 -0400 |
Quote:
Quote:
Quote:
|
sorry for troubling u people all.
|
All times are GMT -5. The time now is 05:22 AM. |