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.
setgid
orsetuid
bit can be very dangerous. Be careful with following this advice. – lindhe Jan 04 '20 at 19:52