LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Closed Thread
 
Search this Thread
Old 02-24-2004, 06:07 AM   #1
hirenpandya
LQ Newbie
 
Registered: Feb 2004
Posts: 2

Rep: Reputation: 0
Question 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
 
Old 02-24-2004, 01:05 PM   #2
cjcuk
Member
 
Registered: Dec 2003
Distribution: Openwall, ~LFS
Posts: 128

Rep: Reputation: 15
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.
 
Old 02-24-2004, 04:47 PM   #3
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
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.
 
Old 02-25-2004, 02:01 AM   #4
hirenpandya
LQ Newbie
 
Registered: Feb 2004
Posts: 2

Original Poster
Rep: Reputation: 0
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
 
Old 02-25-2004, 03:16 AM   #5
cjcuk
Member
 
Registered: Dec 2003
Distribution: Openwall, ~LFS
Posts: 128

Rep: Reputation: 15
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.
 
Old 02-26-2004, 02:58 PM   #6
Half_Elf
Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 45
what's about "chmod 500 /bin/write" ???
 
Old 02-26-2004, 03:18 PM   #7
cjcuk
Member
 
Registered: Dec 2003
Distribution: Openwall, ~LFS
Posts: 128

Rep: Reputation: 15
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.
 
Old 03-03-2009, 10:58 AM   #8
venix
LQ Newbie
 
Registered: Feb 2009
Posts: 8

Rep: Reputation: 0
Quote:
Originally Posted by hirenpandya View Post
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
 
Old 03-03-2009, 03:58 PM   #9
Half_Elf
Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 45
Why in the hell are you replying to a thread of 2003 ?
 
Old 03-03-2009, 06:10 PM   #10
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
venix, please don't go around resurrecting dead threads. Thanks.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabling CD burner write access ? Dynom8 Linux - General 6 09-15-2005 01:59 PM
Write a command cont... ricki Programming 2 07-31-2005 04:53 PM
Disabling Firewall From Command Line Ben Sytko Red Hat 4 02-16-2004 06:27 PM
problem in write command mtest Programming 3 10-30-2003 07:30 AM
disabling user accounts via command line n1wil Linux - Security 3 07-25-2003 06:11 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration