Jump to content

Cifs/samba Filesharing How-to


wiregr

Recommended Posts

So for this how-to, I'm going to walk you through how to install the necessary packages to connect to a CIFS/Samba server from your pineapple.

First, you'll need the following packages:

You can download them all individually, or grab an archive with everything here: cifs-packages.tgz

Just like I mentioned in the Android how-to, these packages are available on the OpenWRT package repository, but they're built against a newer kernel than the pineapple is running (3.3.8 as of this writing, compared to the pineapple's 3.2.14). I checked out an older version of the OpenWRT source (revision 31222 if anyone wants to try this out themselves) and built the necessary packages myself.

Okay, so to install everything, copy all of the ipk files over to the pineapple's /tmp directory. Install them all using the following commands (the order shouldn't matter as we're using nodeps, but if you run each command first without it, the only complaint should be that the kernel hash doesn't match exactly)

opkg --nodeps install /tmp/kmod-crypto-manager_3.2.14-1_ar71xx.ipk
opkg --nodeps install /tmp/kmod-crypto-hmac_3.2.14-1_ar71xx.ipk
opkg --nodeps install /tmp/kmod-crypto-hash_3.2.14-1_ar71xx.ipk
opkg --nodeps install /tmp/kmod-crypto-des_3.2.14-1_ar71xx.ipk
opkg --nodeps install /tmp/kmod-crypto-ecb-1_ar71xx.ipk
opkg --nodeps install /tmp/kmod-crypto-md4_3.2.14-1_ar71xx.ipk
opkg --nodeps install /tmp/kmod-crypto-md5_3.2.14-1_ar71xx.ipk
opkg --nodeps install /tmp/kmod-fs-cifs_3.2.14-1_ar71xx.ipk

Once everything is installed, you can connect to a samba share with the command:

mkdir /mnt/test
mount -t cifs //server/share /mnt/test -o user=username,password=password

Where server is the server ip, share is the name of the shared folder on the server, /mnt/test is the directory on the pineapple where you want the share mounted, and user and password are, well, your username and password ;)

Let me know if anyone has any problems and I'll try to help out, otherwise, enjoy!

(Edit: removed some bad formatting)

Edited by wiregr
Link to comment
Share on other sites

Thanks for the guide but i have a BIG question which is if we have TCPDUMP running on br-lan and using a CIFS share to store logs and fetching fun files, all that traffic will be logged to the pcap file which will make it bloat, i might target wlan0 for the TCPDUMP to avoid this, right?

This also gives me a nice idea of not hooking a usb storage device to the pineapple and using a different IP storage and mount it as /USB.

Does the CIFS shares mount fast after boot up or there is a wait time?

Link to comment
Share on other sites

Thanks for the guide but i have a BIG question which is if we have TCPDUMP running on br-lan and using a CIFS share to store logs and fetching fun files, all that traffic will be logged to the pcap file which will make it bloat, i might target wlan0 for the TCPDUMP to avoid this, right?

This also gives me a nice idea of not hooking a usb storage device to the pineapple and using a different IP storage and mount it as /USB.

Does the CIFS shares mount fast after boot up or there is a wait time?

This is an excellent point. I haven't done a ton of testing, so this is mostly proof-of-concept for now. I would imagine you could tell tcpdump not to include the samba ports for the server ip address (quick google search returns that you can start tcpdump via: tcpdump -i eth1 port not 22 and host 1.2.3.4 to exclude ports for a single ip address).

Edit: Forgot to mention, it looks like samba uses ports 139 and 445 (nmbd uses 137, 138, so might want to block those as well if you're still seeing additional traffic).

Edited by wiregr
Link to comment
Share on other sites

It's a matter of trail and error, good call on not logging the chatty ports instead of logging a different interface.

So all these ipk's fit in the pineapple without choking it memory and speed wise?

Link to comment
Share on other sites

This looks awesome wiregr! I've been trying to get sshfs working on the pineapple to no avail, but this is the next best thing! I want to use the alfa awus036nha that I got from the hakshop, which makes it impossible to use the usb drive for storage of my tcpdumps. I'll try and play around with using samba for storage of the caps instead of sshfs! Thanks!

telot

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...