LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Disabling 'write command' (https://www.linuxquestions.org/questions/linux-security-4/disabling-write-command-149877/)

hirenpandya 02-24-2004 05:07 AM

Disabling 'write command'
 
I have installed Red Hat Linux 9.0 on one machine. This machine has 100 normal users which log in to my Linux Server using TELNET service. The clients are Windows 2000 Professional.

I want to disable 'write' command so that normal users when log in to Linux Server cannot use this command for sending messages to other logged users.

I have tried to use 'alias' command but i dont know how to use it and where to put that command.

Kindly give me solution

Thanx in advance

Hiren Pandya

cjcuk 02-24-2004 12:05 PM

The abilities of the `write' command are dictated by the permissions on the terminals. To stop users being able to write to another users terminal you just have to make sure they do not have the correct Unix permissions to write to the device file.

benjithegreat98 02-24-2004 03:47 PM

What about this....

rm /usr/bin/write
or
mv /usr/bin/write /usr/bin/donotwrite

problem solved. ... Or does that program need to exist for some other reason.

hirenpandya 02-25-2004 01:01 AM

Hello Benji. Thanx for the prompt reply. the mv command is working fine.
But cant i use something like this for displaying warning message "Unauthorized To Send Message" when a user tries to execute "write" command :

alias write = 'echo "Unauthorized To Send Message" '

In which file should I put the above command ?

Thanx once again

cjcuk 02-25-2004 02:16 AM

Quote:

Originally posted by benjithegreat98
What about this....
rm /usr/bin/write
or
mv /usr/bin/write /usr/bin/donotwrite

problem solved. ... Or does that program need to exist for some other reason.

Or problem not solved at all, as it were. As I said, the ability to write is related to the permissions on the terminal. If they still have write permission, then there is nothing to stop them doing `echo "hi pal, lol" > /dev/pts/2'.

Quote:

Originally posted by hirenpandya
alias write = 'echo "Unauthorized To Send Message"'
I would remove the permissions, which should make write fail. If you want to put this alias anywhere then you would put it in a global startup file. However, it is entirely pointless as there is not much stopping the user from removing the alias -- or as shown above, not using write. If you want to solve this problem, look into the permissions set during the chown'ing phase on the terminal.

Half_Elf 02-26-2004 01:58 PM

what's about "chmod 500 /bin/write" ???

cjcuk 02-26-2004 02:18 PM

Quote:

Originally posted by Half_Elf
what's about "chmod 500 /bin/write" ???
As I stated above, removing the write program does not solve the problem. He needs to fix the permissions on the terminals.

venix 03-03-2009 09:58 AM

Quote:

Originally Posted by hirenpandya (Post 777938)
I have installed Red Hat Linux 9.0 on one machine. This machine has 100 normal users which log in to my Linux Server using TELNET service. The clients are Windows 2000 Professional.

I want to disable 'write' command so that normal users when log in to Linux Server cannot use this command for sending messages to other logged users.

I have tried to use 'alias' command but i dont know how to use it and where to put that command.

Kindly give me solution

Thanx in advance

Hiren Pandya

the command your are looking for is mesg n , to enable this back you write mesg y ... but when you logout from you terminal this will return back to normal.. so if you want to have this disabled in whenever you login to bash or csh or any other shell write the command into .bashrc or .cshrc for bash or csh respectively like this :

mesg n

Half_Elf 03-03-2009 02:58 PM

Why in the hell are you replying to a thread of 2003 ?

win32sux 03-03-2009 05:10 PM

venix, please don't go around resurrecting dead threads. Thanks.


All times are GMT -5. The time now is 12:28 PM.