Is it possible to send and receive "Net Send" messages in Linux?
Hi Linux experts,
I was wondering if anyone has ever been able to use the Windows networking "net send" commands in Linux. Either send messages, receive them, or both. Or if this is even possible. I have kernel 2.4.22-10mdk kernel on Mandrake 9.2 Thanks! --A |
You will need samba installed.
I dont remember for sure, but I think it can be done either way smbclient -M hostname message goes here or echo your message | smbclient -M hostname |
Yes, you need two things:
First check what Fur told you ( try smbclient -M ..... and see it wiorks) Then use a friendly client such as linpopup |
What about send a message to another Linux?
|
As long as the other linux is configured the same way and on the same windows domain/workgroup, it will behave just like a windows:
Linux1--linpopup-->samba------------(network)------------>samba-->linpopup--Linux2 |
Cool. Thanks guys - here's the results of fur's suggestion
$ smbclient -M HOSTNAME message added interface ip=192.168.1.157 bcast=192.168.1.255 nmask=255.255.255.0 Connected. Type your message, ending it with a Control-D test messagesent 12 bytes $ So although I typed the message, it seems that smbclient -M will prompt you for it. However, it did successfully send and the client received it. However, I sent a netsend message from the Windows client to myself, and although it said "sent successfully", nothing happened on my Linux computer. Maybe I need linpopup running or something? Anyway, thanks guys. :) |
Yeah, indeed you need linpopup (or whatever graphic client) running.
From LinPopUp documentation: " If you close it, it will continue to receive all messages that are send to you. You can even quit Xwindow, and still receive messages. In fact, the only way to miss a message that was sent to you is to have your computer turned off. " So, as soon as you launch it, it receives messages sent to your linux box. http://linpopup2.sourceforge.net/ http://www.littleigloo.org/software_002.php3 |
Excellent, it works.. thanks :)
|
Is there any way to send to all machines on a domain (equivalent to joining the domain and doing "net send *")?
|
smbclient
hi,
I'm quite new to Linux. I've been trying to use ..... ~]# smbclient -M //192. . . / 'hi hi' but the error is 'Connection to //192. . . / failed' (my purpose is to send message from one linux to another linux machine) Any one can advice me something?? Thanks in advance. |
Hi:
Old thread here ... Try without the "//": # smbclient -M 192.168.x.x You can use //192.168.x.x without the "-M", for connecting to samba/windows machines. # smbclient \\\\192.168.x.x\\share Remember to double the bars to "escape" the shell. And remember the orientation of the bars is inverse on Windows & *nix |
smbclient
Quote:
1) I tried all you asked me to try. But still cannot. Actually, I wanna test sending msg from one machine to another. I tried : smbclient -M \\\\192.168.x.x 'ok ok' smbclient -M \\\\192.168.x.x\\ 'ok ok' smbclient -M 192.168.x.x 'ok ok' The error is ok ok: Not enough '\' characters in service I really have no idea for that error message. 2) And I did test to try to connect to the machine by using: smbclient \\\\192.168.x.x\\home and again the error is Error connecting to 192.168.x.x (Connection refused) Connection to 192.168.x.x failed Does it mean I need to change some settings??(My PC is being set as a server now.) Thank you for your reply.. :) |
1)
You must not provide the content of the message to "smbclient -M" until you receive the message: "Connected. Type your message, ending it with a Control-D" I mean, "smbclient -M" does not send the message you write after the command (in your example 'ok ok') like windows "net send" would. What it does is to establish a channel for you to write the message and then end the session (and send the message) when you press CTRL+D. Take a look. I issued some commands in my shell; - First, your wrong one: $ smbclient -M 10.32.26.11 'ok ok' ok ok: Not enough '\' characters in service Modo de Uso: smbclient ........... - Now, the right one: $ smbclient -M 10.32.26.11 Connected. Type your message, ending it with a Control-D Here begins my test message I can send several lines and even press Enter until I decide to press CTRL+D sent 111 bytes $ 2) Error connecting to 192.168.x.x (Connection refused) This means your samba service is not running or there is a firewall in between. You can always test this with a "telnet" against the right port: Samba port is 445 (old days used to be 136/137/138). So you try a telnet to the target IP via the 445 port. If there is something listening there, it will answer you. I.e: I try to telnet my own PC's samba share: $ telnet 10.32.26.11 445 Trying 10.32.26.11... Connected to 10.32.26.11. Escape character is '^]'. That's good. I am connected. Something answered so I can guess Samba is running on his default port. Now I stop the samba process. Look what happens: $ telnet 10.32.26.11 445 Trying 10.32.26.11... telnet: Unable to connect to remote host: Connection refused |
smbclient
Thank you PabLob,
I learn a lot from you. Now I can successfully connect to the machine. :) 1) But another Error comes out... :D after pressing enter, message start: ERRSRV - ERRmsgoff (Not receiving messages.) 2) I tested 'telnet 192.168.x.x 445' The result is Trying 192.168.x.x... Connected to 192.168.x.x (192.168.x.x). Escape character is '^]'. Then I can't do anything else. Even I can't quit from that command... The same thing happens if I use calculator and some other commands. (For one command, I can quit by typing 'quit'. I don't remember what it is.) But for most commands I tried, I can't quit. Thanks again for your helping. :) |
Quote:
That brings you to a telnet> prompt. At that prompt you can type 'quit'. |
All times are GMT -5. The time now is 11:14 PM. |