# Can't send console message using 'write'

## peaceful

On my old RedHat box, I can type 'write (username)' and then type a message, and then press CTRL-d and it would send a message to that user on the console they were logged on with.

When I try the same thing under gentoo, I get:

```

write: (username) has messages disabled

```

I read 'man write' and it said to make sure it was allowed by doing 'mesg y'.  I did that, but it didn't seem to have any effect.  The man page also said that root should be able to send messages to anyone this way no matter what there settings are, but I get the same error message with root.

Anyone know what's going on here?

----------

## Decibels

I don't have an answer yet, but I tested it and seems to be something in the default settings. Same problem here.

----------

## dma

The other user must type "mesg y" (and you should probably do the same).  It changes the permissions on the user's terminal to allow group "tty" access.  "write" runs setgid tty (if I recall correctly).

----------

## Decibels

My problem might be that not in a multiuser environment. I tried it with one terminal as superuser and the other as you know 'myself'. Both had mesg y set.  Was just trying to help out, but might not be able to if it won't work that way. Anyone in a multiuser env with Gentoo?

----------

## FuzzeX

Might the users need to be added to the tty group? If dma is correct that write uses the setgid bit then it would seem that would be the case.

Just a guess, post if it works.

----------

## peaceful

I am in a multiuser environment, and I had already run 'mesg y' on BOTH root and my regular user, but neither could 'write' to the other or to itself for that matter.

I tried adding both root and my regular user to the tty group.  I made sure 'mesg y' was set on both.  No effect.  Still doesn't work.

What else could I try?

----------

## dma

```
root@laureate:~# qpkg -f `which write`

sys-apps/util-linux *

dma@laureate:~$ ls -la `which write`

-rwxr-sr-x    1 root     tty          8120 Jun 21 19:07 /usr/bin/write
```

----------

## peaceful

 *dma wrote:*   

> 
> 
> ```
> root@laureate:~# qpkg -f `which write`
> 
> ...

 

???

Showing the package that write was emerged from and listing the attributes of the of the write executable doesn't change anything.

Just for fun I checked my 'write' binary too.  The permissions are identical.

Does write work for you?

----------

## dma

I'm on pts/4 here...  You only need to specify it when the user is on more than one terminal.

```
dma@laureate:~$ echo hey | write dma pts/4

Message from dma@laureate on pts/4 at 21:17 ...

hey

EOF

dma@laureate:~$
```

----------

## Decibels

Hmmm, I tried that and from start says: write: you have write permission turned off.

Then did 'mesg y' then got: write: decibels is not logged in on pts/0.

Checked and tty says: /dev/pts/0

Got the same permissions you guys do on the files and in the tty group.

----------

