Find the answer to your Linux question:
Results 1 to 4 of 4
To use the write command, I believe both the sender and the recipient need to have write access enabled to their terminal. The write man page says to do this ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Posts
    10

    write/mesg default settings


    To use the write command, I believe both the sender and the recipient need to have write access enabled to their terminal. The write man page says to do this with the command 'mesg y'.

    It seems to me that depending on how I start my terminal session, the default value of whether write access is enabled or disabled is different. Neither the write or mesg man pages describe where this value is stored or where the default comes from.

    A search of this forum and of google seems to just either return the man pages for the commands or end the discussion with "you can enable it with mesg".

    Does anyone know where the default/initial setting for that access comes from?

    Just playing around, appreciate your responses,

    Jason

  2. #2
    Just Joined!
    Join Date
    Nov 2008
    Posts
    5

    write and mesg commands

    Hi,
    you are telling correct ,maybe internally its defined as a yes option for mesg command.Any more solutions pls welcome for this issue...
    mesg
    The mesg command controls messages received on a terminal.
    -n does not allow messages to be displayed on screen
    -y allows messages to be displayed on screen

    write
    The write command allows inter-user communication. A user can send messages by addressing the other user’s terminal or login id.
    write user-name [terminal number]


    rgds
    gemlin
    Last edited by gemlin; 11-06-2008 at 09:05 AM. Reason: -

  3. #3
    Just Joined!
    Join Date
    Dec 2007
    Posts
    10
    I got a little adventurous last night and went straight to the mesg source code to see how this works. It is quite simple really, it all depends on the terminal device file permissions.

    When I log in at the console, I can check which tty device I am using with the ps command:
    Code:
      PID TTY          TIME CMD
    14751 tty3     00:00:00 bash
    14826 tty3     00:00:00 ps
    So I'm using tty3. Let's see if terminal messages are enabled or not with the mesg command:
    Code:
    jason@compy ~ $ mesg
    is n
    Lets see what the file permissions are on my tty device:
    Code:
    jason@compy ~ $ ls -l /dev/tty3
    crw------- 1 jason tty 4, 3 2008-11-06 07:45 /dev/tty3
    Looks like only I have access to the device. This is consistent with the output of mesg. Thus any other user attempting to write to my terminal will be denied.

    After running 'mesg y', lets check out the permissions again:
    Code:
    jason@compy ~ $ ls -l /dev/tty3
    crw--w---- 1 jason tty 4, 3 2008-11-06 07:45 /dev/tty3
    Now any other user in the tty group will be able to write to my terminal. So there you have it

    I'm not familiar with how to configure udev, but i believe that I see different file permission modes between tty and pty devices which I think explains the different initial permissions for terminal write access.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Nov 2008
    Posts
    5

    -

    well dude...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •