As an example, say that there is a machine named "TEST" with the IP address of
192.168.1.2 out there that I want to connect to. However, I don't know that
it is named "TEST", I only know the IP. I do:
smbclient -L JustAGuess -I 192.168.1.2 -N
If it happens to be an NT box, I will get a response similar to the following:
===
session request to JUSTAGUESS failed (Called name not present)
Domain=[WORKGROUP] OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0]
Sharename Type Comment
--------- ---- -------
Server Comment
--------- -------
TEST
Workgroup Master
--------- -------
WORKGROUP TEST
===
...I then know that it is actually named "TEST" and can connect properly.
However, if it is a 95/98 box, I get the following:
===
session request to JUSTAGUESS failed (Called name not present)
session request to *SMBSERVER failed (Called name not present)
===
...and I can't tell anything about it. I can't determine the host name, so I
can't connect to a share on it -- even if I have the proper share name (which
sometimes I do and sometimes I do not). It seems that with the IP, I should
be able to ask the machine what its NetBIOS name is, yes? Is there something
simple that I am missing?
Thanks...
- John...
> However, if it is a 95/98 box, I get the following:
>
> ===
> session request to JUSTAGUESS failed (Called name not present)
> session request to *SMBSERVER failed (Called name not present)
> ===
This is because samba and nt accept calls to the special name
*smbserver (when you use just the ip), while win9x does not.
Try
nmblookup -A ip.address.of.win9x
and then use the names that hopefully you receive to do
smbclient -L name
Sent via Deja.com http://www.deja.com/
Before you buy.
Hi there! Thanks for the suggestion. nmblookup -A appears to do what I want
-- I get results such as:
===Looking up status of 192.168.1.2
===received 3 names
=== AB <00> - B <ACTIVE>
=== WORKGROUP <00> - <GROUP> B <ACTIVE>
=== AB <03> - B <ACTIVE>
===num_good_sends=0 num_good_receives=0
...and these appears to be what I want. Wouldn't this mean that the host name
for 192.168.1.2 is AB? Or am I misinterpreting what the nmblookup output
means? If I then do a "smbclient -L AB -I 192.168.1.2 -N", I am still
getting:
===session request to AB failed (Called name not present)
===session request to *SMBSERVER failed (Called name not present)
Shouldn't the session request to AB be valid? Even if there were no shares or
anything available, it seems that the "smbclient -L AB ..." would at least
succeed and give some more data.
Sorry for my SMB ignorance here. Please fill me in on what I am not
understanding... :) Thanks!
- John...
>===Looking up status of 192.168.1.2
>===received 3 names
>=== AB <00> - B <ACTIVE>
>=== WORKGROUP <00> - <GROUP> B <ACTIVE>
>=== AB <03> - B <ACTIVE>
>===num_good_sends=0 num_good_receives=0
>...and these appears to be what I want. Wouldn't this mean that the
host name
>for 192.168.1.2 is AB? Or am I misinterpreting what the nmblookup
output
>means? If I then do a "smbclient -L AB -I 192.168.1.2 -N", I am still
>getting:
>===session request to AB failed (Called name not present)
>===session request to *SMBSERVER failed (Called name not present)
First of all, "nmblookup -A ip.address" on samba, is the same of
"nbtstat -A ip.address" on a win9x pc.
Yes, AB is the name you should use with smbclient.
The problem here is that a "normal" pc answers with at least 5 rows.
That pc is lacking the row with "AB <20>". This means that either it
has the tcp/ip-netbios broken/misconfigured or that it has
print-filesharing turned off.
If you try the above commands with other pc's you should see them
answering you with the <20> name too.
See if pc's of the same subnet can access that pc shares.
Ah! Thanks for your help! You were correct and this solved it for me. A
couple of the remote PCs that I was connecting to were configured improperly.
Once I tested some more, I found that some had the additional rows that you
mentioned -- and those ones worked fine. Thanks again!
- John...