Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am logged in to a university system and a very annoying n00b thinks he or she is some awesome hacker because she or he can broadcast an object dump to everyone using pipes. I bet they think it is funny because it looks like the matrix.

I was just wondering if there is a quick and easy way to opt out of recieving these messages from this user. Also what would be the command for all users (sometimes I would not want to recieve a message when I am in the depths of a difficult problem).

share|improve this question

3 Answers 3

up vote 9 down vote accepted

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.

share|improve this answer

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.

share|improve this answer
ls -l /usr/bin/wall
sudo chmod g+s /usr/bin/wall
echo foo | wall
mesg y
acb$ wall test
share|improve this answer
    
Your answer would be more helpful if it explained and motivated the given commands. –  N.N. Feb 27 '13 at 13:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.