How do I opt out of recieving broadcast messages?

The command mesg n opts out of all messages. There is no way to prevent a specific user from sending you wall (Write ALL) message outside of removing execute permissions to the wall command for that user. The default permissions on my Ubuntu Linux computer allows for anyone to run wall and it will send messages to anyone who hasn't opted out with mesg n. Last note on this issue, just run mesg to see the current Opt-in/out status for receiving messages.


The first thing I would do would be to report this clown to the admins. Unfortunately there's no easy way for you to block him and only him.

The command to keep other users from writing messages on your terminal is mesg n. The mesg y command then allows writing again.

What this command does is to change the permissions of your terminal device file (e.g. /dev/tty0 or /dev/pts/8, etc.) to allow or disallow other users from writing to it. Typing who am i at the command prompt will often show you the name of your device, with the /dev/ prefix stripped off.

The traditional UNIX permission system allows you to set permissions separately for yourself, for a single user group, and for all other users. If you and everyone you want to talk to happen to be a member of a group that the h4x0r is not in, it's possible you could chgrp mygroup /dev/myterminal to set the file's group, then chmod 620 /dev/myterminal to set the permissions. (620 is shorthand for "user can read/write, group can write, all others have no permissions".)

Applying an access control list to your device file might be a way to do what you want, but that's system-dependent and non-standard, I've never done it, and it could cause problems for others if the login system isn't expecting it.

Finally, for more info (just in case you don't know already), try the man command -- man chmod, man chgrp, etc.

Tags:

Terminal