LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-16-2004, 10:56 AM   #1
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Rep: Reputation: 33
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
 
Old 12-16-2004, 11:13 AM   #2
fur
Member
 
Registered: Dec 2003
Distribution: Debian, FreeBSD
Posts: 310

Rep: Reputation: 35
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
 
Old 12-16-2004, 11:33 AM   #3
pablob
Member
 
Registered: Apr 2003
Location: Madrid
Distribution: RHEL, Kubuntu, Solaris, TRU64
Posts: 382

Rep: Reputation: 31
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
 
Old 12-16-2004, 12:25 PM   #4
Chowroc
Member
 
Registered: Dec 2004
Posts: 145

Rep: Reputation: 15
What about send a message to another Linux?
 
Old 12-16-2004, 12:52 PM   #5
pablob
Member
 
Registered: Apr 2003
Location: Madrid
Distribution: RHEL, Kubuntu, Solaris, TRU64
Posts: 382

Rep: Reputation: 31
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
 
Old 12-16-2004, 01:14 PM   #6
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
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.
 
Old 12-18-2004, 02:23 PM   #7
pablob
Member
 
Registered: Apr 2003
Location: Madrid
Distribution: RHEL, Kubuntu, Solaris, TRU64
Posts: 382

Rep: Reputation: 31
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
 
Old 12-20-2004, 12:00 PM   #8
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
Excellent, it works.. thanks
 
Old 01-25-2006, 11:39 AM   #9
Twey
LQ Newbie
 
Registered: Nov 2004
Distribution: Fedora Core 4, SuSE 9.1, Debian Sarge, OpenBSD
Posts: 12

Rep: Reputation: 0
Is there any way to send to all machines on a domain (equivalent to joining the domain and doing "net send *")?
 
Old 02-25-2009, 01:41 AM   #10
Sunday03
LQ Newbie
 
Registered: Feb 2009
Posts: 20

Rep: Reputation: 0
Smile 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.
 
Old 02-25-2009, 06:34 AM   #11
pablob
Member
 
Registered: Apr 2003
Location: Madrid
Distribution: RHEL, Kubuntu, Solaris, TRU64
Posts: 382

Rep: Reputation: 31
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
 
Old 02-25-2009, 07:48 PM   #12
Sunday03
LQ Newbie
 
Registered: Feb 2009
Posts: 20

Rep: Reputation: 0
Smile smbclient

Quote:
Originally Posted by pablob View Post
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
.....................................
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..

Last edited by Sunday03; 02-25-2009 at 07:50 PM.
 
Old 02-26-2009, 11:00 AM   #13
pablob
Member
 
Registered: Apr 2003
Location: Madrid
Distribution: RHEL, Kubuntu, Solaris, TRU64
Posts: 382

Rep: Reputation: 31
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
 
Old 02-26-2009, 08:14 PM   #14
Sunday03
LQ Newbie
 
Registered: Feb 2009
Posts: 20

Rep: Reputation: 0
Smile smbclient

Thank you PabLob,

I learn a lot from you.

Now I can successfully connect to the machine.



1) But another Error comes out... 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.
 
Old 02-26-2009, 08:31 PM   #15
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
Quote:
Originally Posted by Sunday03 View Post
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...
^ means the Ctrl key. So the line "Escape character is '^]'" is telling you to press Ctrl ] (Ctrl key and the right square bracket key).

That brings you to a telnet> prompt. At that prompt you can type 'quit'.
 
  


Reply



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
Equivalent of "net send" kamransoomro84 Linux - Software 3 11-12-2005 04:52 PM
Server does'nt send mail until shutdown and LAN can't send or receive. Wolfy Linux - Networking 0 08-02-2004 07:31 PM
error receiving winpopup(net send) messages on my Fedora Core 1 vanquisher Linux - Software 0 02-01-2004 01:27 AM
"permission denied" when I try to send raw data to the sound device. Travis86 Linux - Hardware 2 10-29-2003 09:08 AM
I get a "relaying denied" message when I try to send mail from a remote computer robmainella Linux - Software 4 09-09-2003 10:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:08 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration