Page 1 of 2

Lmhost.sam

PostPosted: Fri May 24, 2002 3:52 am
by The Others
Hi, I guess this goes in here.
Anyhoe - I'm teaching myself through windows networking and have come to a point I can't get past - the lmhost.sam file.

I've edited it to include the IP address' and names of computers I want on my network but nothing seems to happen.

The help with it I didn't find too helpful, can anyone give me a hand with it?

Do i have to have the same workgroup name as those I am trying to connect to? And what result can I expect if I get it working?

The computers I'm tring to add are my mates broadband boxes, therfore they always have the same IP.

Any help would be great, Cheers.

PostPosted: Fri May 24, 2002 4:07 am
by Eitel
Don't use lmhost.sam. There's a file with no extension in that same folder were lmhost is called "hosts". Use that one.

PostPosted: Fri May 24, 2002 4:16 am
by The Others
many thanks

PostPosted: Fri May 24, 2002 4:29 am
by Thorn
"lmhosts" is just for LAN Manager, hence the "lm"

"hosts" is for standard TCP/IP

It depend which networking model you are setting up. Other than that, Eitel is correct: Use the one without the extension, or copy the contents to one without the extension. BTW, Notepad.exe is rather brain-dead when it comes to editing without an extension. If you use Notepad, make sure you check that there is no extension after you save.

Both have .sam files in the \Windows subdirectory. They are samples. Just follow the format in the samples.

Essentially is is:

ip_address <whitespece> computer_name

so:
192.168.0.1 my_pc
192.168.0.2 other_pc

The lmhosts format may be slightly different, as it has been a while since I've fiddled with that. But the sam file should have some instructions.

Names should follow the UNC. (Universal Naming Convention.)

PostPosted: Fri May 24, 2002 4:58 am
by The Others
Thanks, I added the IP and computer name to the hosts file. Now I can go to the command prompt, type ping computer and it will ping the correct IP. I could not view it on my network though (although it is wondows so no surprise) I'll try adding it to lmhost and see if that works.

:)

PostPosted: Fri May 24, 2002 5:13 am
by Thorn
To see the computers in "Network Neighborhood" they have to:
1) Be on the same network (Duh! Bet you figured that one out yourself :))
2) Be on the same segment. (No routers between them.)
2) Be in the same workgroup. (You can work around this, but to start it's easier if they are the same.)
3) Have sharing enabled.

If you are using a Win machine with a *nix, you will need to have Samba, or some other SMB program, running.

Cheers,

PostPosted: Fri May 24, 2002 5:15 am
by The Others
Well...

It didn't work.

XP is great for being completly automated but when you want to do anything without the help of wizards or the like it just gets in the way.

Sorry to be so lame but does anyone know where i'm going wrong? I want to be able to browse my friends shares over the net just as if we were on the same LAN.

Thanks.

PostPosted: Fri May 24, 2002 5:17 am
by The Others
To see the computers in "Network Neighborhood" they have to:


Cheers thorn, we posted at the same time so I didn't see your reply until after mine had gone up. I'll check it out. Thanks for the help.

PostPosted: Fri May 24, 2002 5:31 am
by Thorn
Originally posted by The Others
...
Sorry to be so lame but does anyone know where i'm going wrong? I want to be able to browse my friends shares over the net just as if we were on the same LAN.

Thanks.


You're talking something completely different now!

To browse your friend's PC over the Internet:

1) Have him turn on Sharing on a subdirectory or drive. Make sure that he sets it to either "Read" or "Full" depending on what you guys are trying to do.
2) Get the IP address of his machine.
3) Goto the the "RUN" dialog (or the XP equivilent.)
4) Enter the following w/o the quotes: "//xxx.xxx.xxx.xxx"

After a little time (depends on your connection, his connection and 'net traffic conditions) you should see his share(s) show up. Navigate as you normally would in Windows. You may enter that as "//xxx.xxx.xxx.xxx/sharename" to go right into a particular share.

WARNING! THIS PROCEDURE IS NOT SAFE FOR YOUR FRIEND'S PC!

If you can connect, so can anyone one else that gets his IP address. If he is on a system like cable TV connection, other poeple on the same system may be able to see his PC and shares in "Network Neighborhood."

Cheers.

PostPosted: Fri May 24, 2002 6:34 am
by blackwave
Originally posted by Thorn
BTW, Notepad.exe is rather brain-dead when it comes to editing without an extension.


For whomever cares if you Save As "hosts" it will save without extension. This only works when you have " "wrapping the filename. this works for any filename and extension... if you do not use " " it will save with the default .txt even if you add your own filename example:

Save As test.bat will actually save as test.bat.txt
Save As "test.bat" will actually save as test.bat

tah dah! <trumpet blurp here>

however, ultraedit is a neater tool and you don't have to futz with cheesy things... but notepad is nice for a quick boost.... if you are really a man though you would use COPY CON ;) especially if you have never used your hosts file before!... otherwise you can use the COPY command to append to the file instead of overwrite it...

COPY CON hosts
#[hosts file]
#created new file
127.0.0.1 localhost
^Z

COPY CON hosts.tmp
# date is today, found new popup
192.168.0.35 junk.com
^Z

COPY hosts + hosts.tmp

So the end results looks like this:

#[hosts file]
#created new file
127.0.0.1 localhost
# date is today, found new popup
192.168.0.35 junk.com

PostPosted: Fri May 24, 2002 6:39 am
by blackwave
Originally posted by Thorn
WARNING! THIS PROCEDURE IS NOT SAFE FOR YOUR FRIEND'S PC!


Holy Crap!, understatement of the year... :)

You are a "little" safer setting up SSH, FTP - stripping the service of all headers, and putting it on a non-con port...

PostPosted: Fri May 24, 2002 6:57 am
by Thorn
Originally posted by blackwave


Holy Crap!, understatement of the year... :)


OH, YASS! But he wanted to know how to do it. So I told him. I just felt he deserved to know the danger too. What I really wanted to post was:

DANGER! DANGER! WARNING, WILL ROBINSON!

THIS PROCEDURE IS NOT SAFE FOR YOUR FRIEND'S PC!


But I want sure about the cross cultural things, like Lost In Space reruns in the UK. On the other hand, I love my satellite TV link. I now get all my favorites from my short UK stays: Father Ted (the best!), Ground Force, Changing Rooms, & Vicor of Dibley. Just wish I could get Murder Most Foul...

Cheers,

PostPosted: Fri May 24, 2002 2:45 pm
by lullabud
Originally posted by Thorn

To browse your friend's PC over the Internet:

1) Have him turn on Sharing on a subdirectory or drive. Make sure that he sets it to either "Read" or "Full" depending on what you guys are trying to do.
2) Get the IP address of his machine.
3) Goto the the "RUN" dialog (or the XP equivilent.)
4) Enter the following w/o the quotes: "//xxx.xxx.xxx.xxx"


it's actually "\\IP#", quotes don't matter. i've also seen problems with certain firewalls or routers when you're browsing from behind them, not to the pc behind it. sorta strange, possibly a bug with those firewalls or routers. try port forwarding 139 to your browsing pc if it's still not working. however, some ISP's also filter 139 due to it's numerous vulnerabilities (or neglegence to secure it). in that case you'd want port mapping...

PostPosted: Fri May 24, 2002 11:30 pm
by Thorn
Originally posted by lullabud


it's actually "\\IP#", quotes don't matter. i've also seen problems with certain firewalls or routers when you're browsing from behind them, not to the pc behind it. sorta strange, possibly a bug with those firewalls or routers. try port forwarding 139 to your browsing pc if it's still not working. however, some ISP's also filter 139 due to it's numerous vulnerabilities (or neglegence to secure it). in that case you'd want port mapping...


Thanks for catching that "\\". I always goof up what slashes go which way on a given system. The price we pay for jumping from Windows to *nix, to *nix to Windows...

Also Ports 137 and 138 are tied in there, too. All three (both TCP & UDP) are tied to the NETBIOS service:
netbios-ns 137 NETBIOS Name Service
netbios-dgm 138 NETBIOS Datagram Service
netbios-ssn 139 NETBIOS Session Service

Cheers,

PostPosted: Sat May 25, 2002 12:10 am
by Dr3D1zzl3
dont forge t the 44* series of ports used by win2ghey. 443 aint it?