14

I have a user of name x in tty1 and y in tty2. Now x wants to write some message to y and vice-versa. Now I typed in tty1 terminal write y tty2 It is showing

write:write:you have write permission turned off

write:y has messages disabled

Same thing is showing when y's sending message to x instead it is 'x' in the last line. What should I do?

saptarshi nag
  • 275
  • 1
  • 3
  • 11

4 Answers4

18

It seems that y has turned off messages.

In y's terminal, type:

$ mesg
is n

meaning y does not allow others to write to y's terminal. Then you should try:

$ mesg y

Note

This option y in above command is different with y user in your case.

From man mesg:

NAME
       mesg - control write access to your terminal

SYNOPSIS
       mesg [y|n]

DESCRIPTION
       Mesg  controls the access to your terminal by others.  It's typically used to allow or disallow other users to write to your terminal
       (see write(1)).

OPTIONS
       y      Allow write access to your terminal.

       n      Disallow write access to your terminal.

       If no option is given, mesg prints out the current access state of your terminal.
cuonglm
  • 150,973
  • 38
  • 327
  • 406
3

If X is the usr who wants to pop a message on y machine. Fisrt take the terminal id of y machine and both should be on the same host. you can send a message like below.

  1. Type who command and see the terminal id of y machine( for example pty/1 is the terminal ID of y)
  2. echo "Hello" 1> pty/1(this will display the message on y machine.
Anthon
  • 78,313
  • 42
  • 165
  • 222
Anil
  • 31
  • 1
2

You cannot do anything (unless you are the root user).

Each user can enable/disable other users ability to send messages to them using the command mesg. This command can be put into your .bashrc or .login file (depending on shell).

The default if you do nothing is to protect the user from these interrupting messages from other users.

mdpc
  • 6,736
  • 3
  • 32
  • 46
0
> $ who
bouba    :0           2015-07-30 07:10 (:0)
jdone    pts/1        2015-07-30 20:07
bouba    pts/12       2015-07-30 20:39 (:0)
> $ mesg y
> $ write jdone

jdone its your userName and here type your message and press Entre To send

yaegashi
  • 12,108
  • 1
  • 36
  • 41
Hajime Beddai
  • 119
  • 1
  • 2