Saturday, 7 July 2012

Linux talk - talk to another user


I came across talking to same users(/etc/passwd)in the local server. The same could be used to even talk to the users remotely.

To talk to the user who is logged in more than once, use ttyname to indicate the appropriate terminal name.Once communication has been established, the two parties may type simultaneously.

Let's see how can we configuire this.

1. Verify the package is installed, if not install by 'yum' or 'rpm'.
[root@server ~]# rpm -qa | grep talk
talk-0.17-29.2.2
talk-server-0.17-29.2.2
[root@server ~]#

2. Change Disable=no in talk file.
[root@server ~]# vi /etc/xinetd.d/talk
# default: off
# description: The talk server accepts talk requests for chatting with users \
#       on other systems.
service talk
{
        flags                   = IPv4
        disable                 = no
        socket_type             = dgram
        wait                    = yes
        user                    = nobody
        group                   = tty
        server                  = /usr/sbin/in.talkd
}

3. Make sure both 'talk' and 'ntalk' are 'on'
[root@server ~]# chkconfig --list | grep talk
        ntalk:          on
        talk:            on

4. Restart 'xinetd' service to take effect.
[root@server ~]# service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                            [  OK  ]

Case 1:
I shall communicate to different user(login names)on the same server. 

[root@server ~]# grep "^root" /etc/passwd
root:x:0:0:root:/root:/bin/bash

[root@server ~]# grep "sysadm" /etc/passwd
sysadm:x:854:855::/home/sysadm:/bin/bash







Case 2:
Talk to a user who is logged in more than once.Here, you need to communicate with their terminal name.

[root@server ~]# tty
/dev/pts/1

[sysadm@server ~]$ tty
/dev/pts/3




Enjoy CLI in your work environment.

No comments:

Post a Comment