What command prevents other users from sending you messages?

Transfered from Linux Config Disqus comments:

Question:
What command prevents other users from sending you messages? How do you reset the variable to allow messages once again?
Answer:
To stop other to send you a local message using your terminal use mesg command. The syntax is simple as :


mesg y 

to allow others to access your terminal thus writing you a message where


mesg n 

does the exact opposite.

You can view your current mesg settings by executing the mesg command without any arguments and options:


dmesg