how to issue a message prior to login prompt for a particular user
I want to issue a command prior to login prompt from root for a particular user.
but when i write echo "Contact System Admin" >> /etc/issue, it is showing the message to all users. I want to issue for a particular user pls reply this |
Prior to login, you dont know who the user are.. how could you present a message just to one user? You have to present the message after logon. Or write something like this in /etc/issue: "JoeUser please contact System Administrator"
|
i want to issue a message such as "Contact System Admin" for a particular user whenever that particular user logs in and the user work must be suspended i.e the user must not be allowed to do any thing else.
so can u tell how this can be acheived. |
Add this line
echo "Meet system administrator" in that particular user's .bashrc or .bash_profile Then as soon he logs in he gets that message |
Or you compile a small program that echo outs "You banned" and then terminates, you set the users shell in /etc/passwd to this program.. That would do what you request =)
|
Mr Satan thanks for ur help.
keeping the message in .bashrc or .bash_profile will issue a message whenever the user logs in, but the user will do his work. what i need is after the message is displayed the user must be suspended from work |
write a program that will be invoked as the user's shell when he logs in. your program will do filtering, and either execute the user's default shell or terminate.
|
thanks MR infamous41md for ur quick reply.
but i didn't understand this. can u clearly explain this again sorry for troubling u. |
There doesn't seem much point in letting them log in but then try and stop them doing anything once they are logged in.
It's probably just easier to change their login shell to /bin/false or whatever and wait for them to come running to you but as simple as it gets I guess is adding to there .bash_profile echo "Please contact admin, bad guy" logout which will log them out straight away |
Even I too agree with Looking_Lost
But just joking :- Suppose your bad guy is really intelligent n after he has been logged off once, he'll know that you have changed his .bash_profile Maybe he'll ftp an another .bash_profile onto his login :- You'll have to disable his ftp as well. Just joking , I personally don't think he'll be doing it . He'll be rushing to system administrator P.S :- I did it once when a friend of mine put a logout in my bash_profile for fun. |
Assuming they managed to bypass the biometric scan security layer, doesn't everyone use it ? Plugs right into your serial port scans the iris and doubles up as a barcode reader
:) |
Mr SATAN
can u tell how to ftp an another .bash_profile onto their own login thanks in advance |
It's just as you ftp an another file
Ok follow these sequence of steps Get into the login of ur friend [Let us say donor] On his konsole type these Code:
[donor@students donor]$[COLOR=dark red] ftp 192.168.36.205[/COLOR] You can even use scp for this Check man scp for this |
If u give just access permissions to .bash_profile for the perticular user as root,Is it possible to override .bash_profile when u did ftp ??.Just a dout!.
|
access permissions ???
can u be a bit more clear abt it |
All times are GMT -5. The time now is 03:15 AM. |