Solved

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

Posted on 2004-10-21
194 Views
Last Modified: 2013-12-06
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
Question by:SiliconDirect
    5 Comments
     
    LVL 5

    Expert Comment

    by:Anonymouslemming
    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
     

    Author Comment

    by:SiliconDirect
    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
     
    LVL 5

    Expert Comment

    by:Anonymouslemming
    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
     

    Author Comment

    by:SiliconDirect
    so I have to edit the following files?

     .bashrc
    .profile



    0
     
    LVL 5

    Accepted Solution

    by:
    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Lean Six Sigma Project Manager Certification

    There are many schools of thought around successful project management, but few as highly regarded as the Six Sigma and Lean methods. With 37 hours of learning, this training will explain concrete processes for increasing efficiency and limiting wasted time and effort.

    Suggested Solutions

    The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
    It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    884 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now