LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-12-2003, 11:45 PM   #1
VirtueTech
LQ Newbie
 
Registered: Jul 2003
Posts: 7

Rep: Reputation: 0
Does samba only work on local networks?


Hello,

I'm trying to use Samba to allow my windows machine to "map a network drive" from my REMOTE linux machine.

I'm not having any success. I've had success before wit Samba on a local network.

Thus my question is does Samba only work on local networks?

Do I have to setup a VPN first then setup samba?

Thanks in advance.
 
Old 07-12-2003, 11:55 PM   #2
green_dragon37
Member
 
Registered: Oct 2002
Location: Lower Alabama
Distribution: Slackware, OpenBSD 3.9
Posts: 344

Rep: Reputation: 31
oops, wrong thread...
 
Old 07-13-2003, 12:09 AM   #3
mlp68
Member
 
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333

Rep: Reputation: 40
That depends how "remote" your other machine is. The samba ports (137...139) are not considered very secure and no netop in his right mind would let that through. The ports usually get blocked in the firewalls along the way. In addition, it would be really, really slow.

Now if you have ssh access from your windows to the remote machine, it's best and more efficient to tunnel the connections.

Here's how ( replace remote-mchine with the name of you actual one)

Quote:
ssh -L 139:remote-machine:139 -L 137:remote-machine:137 -L 138:remote-machine:138 yourname@remote-machine
That tunnels all 3 ports in question. You must do this as root on a Linux box, but I believe your windows machine lets you do this anyway.

Then if //remote-host/share is the sharename, substitute //localhost/sharename

[ map network drive -> then type it ]. On Linux I just tried that and typed

Quote:
mount -t smbfs //localhost/share /mountpoint
Works fine.

If you wonder where you type the ssh command on windows, download and install cygwin (http://www.cygwin.com ). At the installation config, add the ssh stuff.

Hope it helps,

mlp
 
Old 07-13-2003, 12:18 AM   #4
VirtueTech
LQ Newbie
 
Registered: Jul 2003
Posts: 7

Original Poster
Rep: Reputation: 0
First thanks for your reply. Sorry if these questions are too newbie'ish

When you typed: mount -t smbfs //localhost/share /mountpoint

Your mounting FROM a windows share. I want to MAP from a linux share.

Also...just to verify I understand this...this still uses Samba, but it uses SSH for security right? Will I have to enter that SSH command on every windows boot? Or will it save it?

Thanks again.
 
Old 07-13-2003, 01:25 PM   #5
mlp68
Member
 
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333

Rep: Reputation: 40
Hi VirtueTech,

no, what I called //localhost/share or //remote-host/share is the "share" on the Linux box. I understood from your post that the share you want to mount is hosted on Linux, such as your home diretory there or something. That's how a share looks in both windows and Linux. In this example, I mapped, in your nomenclature, from a Linux share (I changed the names for obscurity, but it was actually my unix home directory at work).

ssh has many applications, one of them being a secure, encrypted, autheticated telnet replacement. Its other function is to provide a tunnel for other protocols to "tunnel through", either for added security or because the protocol in question (such as Samba) is normally blocked.

So when I write (I leave the other ports out for clarity,same thing)

ssh -L 139:remote-machine:139 yourname@remote-machine

that opens a tunnel for port 139. The port 139 on your machine (localhost) is really the entrance to the tunnel that ends at port 139 at remote-machine, just as if you had gone to port 139 on the remote-machine directly, except that port isn't accessible directly. So all traffic of that protocol travels through the tunnel.

Yes, you have to repeat the command each time you boot and also each time the ssh session terminates, but then you put that in a script and it's no hassle at all.

Good luck,
mlp
 
  


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
samba on small networks? e1000 Linux - Software 5 10-21-2003 07:17 PM
Does samba only work on local networks? VirtueTech Linux - Security 0 07-12-2003 11:37 PM
Samba Issues in RHL8.0/Win2k Networks dfirst_me Linux - General 5 07-09-2003 08:57 AM
Masquerading between two Local Networks acpi Linux - Networking 6 06-05-2003 08:35 AM
Samba across Networks santiagodelgado Linux - Networking 1 11-18-2001 02:05 AM

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

All times are GMT -5. The time now is 05:06 PM.

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