>So, then you have to move on to the second level. You're going to have to
>modify the 'write' source code. I've done it. It's pretty easy. You have
>to find the line where it echos your name and stuff. It will be something
>like 'fprint('%s message from %s .....', etc.)'. Just eliminate that line
>and recompile it with 'cc write.c -o write'.
On the machines I've used, write is sgid and is in some group which
has write permission on tty's. Compiling my own write isn't going to
do any good since random users can't create files sgid to groups they
don't belong to.
Why would you want that? :)
It's all going to depend on how good you are at programming and debugging.
If you're not, then use the 'cat' command. Either 'finger' or 'w' the
person and find out which tty their using. Then just do a :
cat thefile > /dev/(their_tty)
their tty will be something like 'ttyp1'.
Sometimes, you can't do this. You won't be allowed to 'write' to a tty file.
So, then you have to move on to the second level. You're going to have to
modify the 'write' source code. I've done it. It's pretty easy. You have
to find the line where it echos your name and stuff. It will be something
like 'fprint('%s message from %s .....', etc.)'. Just eliminate that line
and recompile it with 'cc write.c -o write'.
I've also edited the write source to ignore the 'mesg n' that a
user uses. So, I can just dump to their terminal without indicating my
name and even if they have messages off.
Michael Ko
/ ...the chances of getting picked up by another/ The Invincible \
/ ship within those thirty seconds are 2 to the / vin...@cs.jhu.edu \
\ power of 276709 to one against." - From The \ Computer Science Depart. /
\ Hitchhiker's Guide to the Galaxy - D. Adams \ Johns Hopkins University/
I made a mistake. That line you should looking for should start with a
printf not fprint.
: > is there any way to find out who has sent it? Some joker seems
: > to enjoy doing that on my machine at the most inopportune moment,
: > and by the time I quit/suspend whatever I'm doing (with a great
: > deal of hostility too I might add) and have totally lost my train
: > of thought due to the interuption, I run a process check to see
: > whodunnit, but it is too late. The culprit has seemingly vanished!
: > Is there any way I can check a user's history for a given time
: > period, or do I have to be a superuser? I'm just a lowly student..
: > Thanks!
I don't know if you'll be able to tell who that person was after he/she
has logged off. But, can you change the access privileges to your tty file?
use something like 'chmod 760 /dev/<tty>'. The 7 will allow you to
read/write/execute the file, the 6 will allow people in your group(if you
have any) to read/write the file.
Michael
>vin...@cs.jhu.edu (Michael Young Ko) writes:
>>Glen Hunt (gh...@cs.mun.ca) wrote:
>>: Is it possible to use the write command without having your identity
>>: come up on the reciever's screen? I have heard of the CAT command, but
>>: I'm not sure how to use it. Any help would be appreciated(?)
>>It's all going to depend on how good you are at programming and debugging.
>>If you're not, then use the 'cat' command. Either 'finger' or 'w' the
>>person and find out which tty their using. Then just do a :
>>cat thefile > /dev/(their_tty)
>>their tty will be something like 'ttyp1'.
>>Sometimes, you can't do this. You won't be allowed to 'write' to a tty file.
> is there any way to find out who has sent it? Some joker seems
> to enjoy doing that on my machine at the most inopportune moment,
> and by the time I quit/suspend whatever I'm doing (with a great
> deal of hostility too I might add) and have totally lost my train
> of thought due to the interuption, I run a process check to see
> whodunnit, but it is too late. The culprit has seemingly vanished!
> Is there any way I can check a user's history for a given time
> period, or do I have to be a superuser? I'm just a lowly student..
> Thanks!
>--
>* Faye Pashalis: The Unknown Beatle. O O O O *
>* Email: s92...@otto.bf.rmit.edu.au < < < < *
>* THE DREAM MAY BE OVER, BUT IT WILL /\ /\ /\ /\ *
>* NEVER BE FORGOTTEN... goo goo g'joob -ascii ABBEY ROAD LP, 1969 *
You can try using the last(1) command, it will last who has been logged
into the machine and when.
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
| Marcus B Irven mir...@vnet.ibm.com |
| mir...@coewl.cen.uiuc.edu IBM Personal Computer Company |
| University of Illinois, Research Triangle Park, |
| Urbana-Champaign North Carolina |
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
| It takes a big man to cry, but it takes a bigger man to laugh at |
| that man. -Jack Handy |
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Also being a lowly student, I use the following command (although I
rarely have to):
lastcomm write
This will display the user ids of the last people to use `write`.
The output is in chronological order, so the first user is usually
the culprit. My local machine is a sunsparc10 running sunos4.1.3
so `lastcomm` may not be available on your machine.
Liam.
>It's all going to depend on how good you are at programming and debugging.
>If you're not, then use the 'cat' command. Either 'finger' or 'w' the
>person and find out which tty their using. Then just do a :
>cat thefile > /dev/(their_tty)
>their tty will be something like 'ttyp1'.
>Sometimes, you can't do this. You won't be allowed to 'write' to a tty file.
>So, then you have to move on to the second level. You're going to have to
>modify the 'write' source code. I've done it. It's pretty easy. You have
>to find the line where it echos your name and stuff. It will be something
>like 'fprint('%s message from %s .....', etc.)'. Just eliminate that line
>and recompile it with 'cc write.c -o write'.
I tried the first technique you suggested on myself and it worked
perfectly. However, when I tried it on a friend of mine it didn't work,
just as you predicted. So on to the second level I went, and I must add
that I know nothing about programming. The system I use operates under
the K-shell, if that means anything. So when you suggested modifying(?)
the 'write' source code, I assumed you were talking about modifying the
configuration files. On this shell there are two that I know of:
1. .profile
2. .kshrc
In these two files I could find nothing close to what you described. Am
I doing something wrong? Is the situation still salvagable? AM I BEYOND HELP?
: >So, then you have to move on to the second level. You're going to have to
: >modify the 'write' source code. I've done it. It's pretty easy. You have
: >to find the line where it echos your name and stuff. It will be something
: >like 'fprint('%s message from %s .....', etc.)'. Just eliminate that line
: >and recompile it with 'cc write.c -o write'.
: I tried the first technique you suggested on myself and it worked
: perfectly. However, when I tried it on a friend of mine it didn't work,
: just as you predicted. So on to the second level I went, and I must add
: that I know nothing about programming. The system I use operates under
: the K-shell, if that means anything. So when you suggested modifying(?)
: the 'write' source code, I assumed you were talking about modifying the
: configuration files. On this shell there are two that I know of:
: 1. .profile
: 2. .kshrc
: In these two files I could find nothing close to what you described. Am
: I doing something wrong? Is the situation still salvagable? AM I BEYOND HELP?
No, not the .profile or .kshrc files. You have to get the source code and
recompile it, to form a new program. If you want, I'll e-mail to you.
Just e-mail me. But, in that source code, you have to erase the program
lines that print to the screen who is writing. It's pretty simple.
MIchael
-----------------------------------------------------------------------
/ The Invincible / "... A monk, a clone, and a Ferengi /
/ vin...@cs.jhu.edu / decide to go bowling together..." /
/ Computer Science Dept. / Data in "The Outrageous Okona" /
/ The Johns Hopkins University / Star Trek : The Next Generation /
-----------------------------------------------------------------------
Not even close! write is written in C so to make any changes to write you
would have to edit the source code and recompile it. Judging by your
response you might not be ready for this.
Good luck.