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
[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@server ~]# grep "sysadm" /etc/passwd

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

[sysadm@server ~]$ tty

Enjoy CLI in your work environment.

No comments:

Post a Comment