Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

Can I Send messages to other users in Mandrake 10 without installing anything?

I'm using mandrake 10.
Can I Send little messages to other users on the server so they get them when they log in to it ?
I don't want to install any programs if possible?
Thanks.
0
SiliconDirect
Asked:
SiliconDirect
  • 3
  • 2
1 Solution
 
AnonymouslemmingCommented:
You can always use echo...
Find out what tty the user is logged into by running w
Then send a message to a user as follows:

echo "hello user" > /dev/pts/1 (or whatever TTY the user is logged into)
0
 
SiliconDirectAuthor Commented:
I wrote "so they get them when they log in to it ?"
This sentence would mean that the other user is not logged on yet.
0
 
AnonymouslemmingCommented:
Sorry - I missed that part.

If you want to send to all users at once, you could just add the message to /etc/motd and ensure that this is displayed by /etc/profile

If you want to send to individual users, you could add the following lines to each user's .bashrc, .profile or .bash_profile (Whichever is appropriate for your distro)

cat $HOME/.loginmessage
cat /dev/null > $HOME/.loginmessage

Then when you want to send a message to a user at login, just edit .loginmessage in their homedirectory. The next time that they login, the contents of this file will be displayed and then the file will be blanked, so the user will only see it once.

HTH

0
 
SiliconDirectAuthor Commented:
so I have to edit the following files?

 .bashrc
.profile



0
 
AnonymouslemmingCommented:
I'm not sure how Mandrake will handle these files as many Linux distributions handle them differently.

On Fedora (all I have at the moment), .bash_profile includes .bashrc right near the beginning. So any setting in .bashrc that is also in .bash_profile will use the value from .bash_profile.

I would suggest starting with .profile, and if that doesn't work, move it to .bashrc

A good thing to look for would be the following line in .profile
. ~/.bashrc

If that appears, then .profile is including .bashrc and you shuold edit .profile
The reverse is true if you find the line
. ~/.profile
in .bashrc

Also, if you want this functionality for any new users that you create, you should add those lines to whichever file turns out to be correct (.bashrc or .profile) in /etc/skel
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now