Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
samba client and iptables
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
WaMan
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jun 2002
Posts: 96

PostPosted: Mon May 10, 2004 2:50 am    Post subject: samba client and iptables Reply with quote

I would like to use the samba client to see some windows shares. I have not set up any samba shares. What is the minimum set of iptables rules that will allow the nautilus smb: client to work?
'iptables -A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT' doesn't seem to be enought.
Back to top
View user's profile Send private message
turtlendog
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jan 2004
Posts: 107
Location: East AZ

PostPosted: Mon May 10, 2004 5:28 am    Post subject: Reply with quote

This almost calls for ascii art. :-)

I''m on a large network that I don't trust. I use a firewall. I need to use Microsoft-mail to pick up email from the un-trusted network (ms-mail uses SMB). It happens that I control several Linux computers in my DMZ and have one running 24/7 on the wild network.

This sctipt uses ssh to connect to a computer inside my DMZ which does not need SMB (otherwise I would have to do some trick to change the ports if I wanted to use this and SMB on the same host).

SSH forwards my packets to the only SMB host I need to talk to (using encryption BTW). (It could just as well be the sshhost)

When I want to do a MS-mail transaction:

I start the following script...

Direct my MS-mail queries at the DMZ host which is doing the forwarding.

Download my mail.

And kill the script to bring down the tunel.

I have been meaning to automate it when a mail event happens, but haven't gotten arround to it yet.

Code:
#!/bin/bash


  trap cleanup INT

  # the target host (cd-tower)
  smbhost=10.10.72.5

  # my ssh host on the same subnet as the smbhost
  sshhost=rmccweb

  # command
  cmd="ssh -gNL 137:$smbhost:137 -L 138:$smbhost:138 -L 139:$smbhost:139 $sshhost"

  function cleanup(){
        echo "Bringing down the SSH tunnel to $smbhost through $sshhost."
        echo "The following ssh processes are now running on $sshhost."
        ssh $sshhost ps x | grep ssh
        exit 0
  }

  echo "Forwarding SMB over SSH to $smbhost through $sshhost..."
  echo "Use CTRL+c to bring down the tunnel."
  ssh jemima "$cmd&"


It should be adaptable to your problem.

The process list is so that I can make sure that the tunel came down.

If you run SMB on the firewall (why would you if it's a real firewall?) you can also mount from there, then reshare the mounted dir on the inside.
Back to top
View user's profile Send private message
WaMan
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jun 2002
Posts: 96

PostPosted: Tue May 11, 2004 11:07 pm    Post subject: Reply with quote

Thanks for the reply, but I'm not really sure if that's what I'm looking for. I just want to know what the minimum set of iptables rules are that will allow my smb client (not server) to browse the network.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum