How to install samba

Posted by neomars 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
How to install samba
August 26, 2012 03:42PM
Hello ,
I'm looking for an an "how to" to install and configure samba on piratebox.
I've doing this but I've no results. I want to mount to user the "Shared" folder.

Install samba server
opkg list sa*
opkg -d piratebox install samba36-server
find / -name samba

vim /mnt/ext/etc/init.d/samba

Change
start() {
        config_load samba
        config_foreach smb_header samba
        config_foreach smb_add_share sambashare
        #service_start /usr/sbin/smbd -D
        #service_start /usr/sbin/nmbd -D
        service_start /mnt/ext/usr/sbin/smbd -D
        service_start /mnt/ext/usr/sbin/nmbd -D
}

stop() {
        #service_stop /usr/sbin/smbd
        #service_stop /usr/sbin/nmbd
        service_stop /mnt/ext/usr/sbin/smbd
        service_stop /mnt/ext/usr/sbin/nmbd
}
cp /mnt/ext/etc/samba/smb.conf.template /mnt/ext/etc/samba/smb.conf

/mnt/ext/etc/init.d/samba start
Re: How to install samba
September 25, 2012 05:01PM
bump
Re: How to install samba
September 27, 2012 08:58AM
Does this work? If yes, I'll add this to my Modification of the PirateBox Packages
Re: How to install samba
August 15, 2014 01:33PM
got an error

had to do this instead...
opkg -d ext install samba36-server

still could not connect to \\192.168.1.1
Re: How to install samba
August 17, 2014 10:44AM
Are you sure samba is running?
did you start it?
did you link some stuff to /etc/init.d/ and the config files?

More information about what you did would be helpful??
Re: How to install samba
August 17, 2014 07:22PM
opkg -d piratebox install samba36-server

error ...
resolve_pkg_dest_list: Unknown dest name: 'piratebox'.

can't even get it to install.
Re: How to install samba
August 17, 2014 07:37PM
did not except for the instructions above, make a change when 'piratebox'could not be used, so i replaced it with 'ext' and was able to install the package.

executed the commands above but PS, does not show any samba, smb nmb processes running.

BTW what should I expect as a transfer speed?
I.E. a 10MB MP3 file file should take how long using wired or wireless, with WinSCP or Samba?

Thanks for your help.
Re: How to install samba
August 19, 2014 05:39PM
do you get any error message after running
/etc/init.d/sambe
?

I can't estimate any speed prediction, because it mostly depends on your USB Stick.

I managed - using scp - to get close to 8MB/s via ethernet


This is only my signature.
Re: How to install samba
July 05, 2015 07:35PM
I have been trying to do this for quite some time with no success. Would anyone be kind enough to post clear directions that I may attempt to follow?
Re: How to install samba
July 05, 2015 07:38PM
(I'm running the openwrt build on a tplink mr3040 for those who are interested)
Re: How to install samba
August 31, 2015 12:00AM
The PirateBox will need temporary internet connectivity to install Samba.

Here's the route I used. Using a 128GB Sandisk USB stick on a TP-LINK TL-MR3040.


Got to install samba, so I did:
opkg update
opkg -d ext install samba36-server

Since it's been installed to 'ext', we need to convince OpenWRT to run it as though it's installed normally, so we create symlinks:

ln -s /mnt/ext/etc/init.d/samba /etc/init.d/samba
ln -s /mnt/ext/etc/samba /etc/samba
ln -s /mnt/ext/etc/config/samba /etc/config/samba
ln -s /mnt/ext/usr/sbin/smbd /usr/sbin/
ln -s /mnt/ext/usr/sbin/nmbd /usr/sbin/

I may have missed some, but this got it going for me, so good enough.
Now we need to configure the Samba share.

Edit /etc/config/samba, adding:
config 'samba'
        option 'name' 'PirateBox'
        option 'workgroup' 'WORKGROUP'
        option 'description' 'PirateBox - Share Freely'
        option 'homes' '1'

config 'sambashare'
        option 'read_only' 'no'
        option 'create_mask' '0700'
        option 'dir_mask' '0700'
        option 'name' 'Shared'
        option 'path' '/mnt/usb/PirateBox/Shared'
        option 'guest_ok' 'yes'

This creates the share and makes it available. Right now, this is read/write, which means anyone can go in and delete what ever they want, if they choose to. I'm still attempting to figure out how to not allow deleting, but I'm not hopeful.

Now we need to get samba up and running.

Start Samba:
/etc/init.d/samba start

And we want Samba to run every time we start the PirateBox, so we enable it to run at boot.
/etc/init.d/samba enable

Optional, but I've added to the alert on the webpage for people to be aware they can access it through a file folder on Windows. Completely not necessary, but I thought it would be nice to have:
cp /opt/piratebox/www/index.html /opt/piratebox/www/index.orig
sed -i 's|and feel free to share any files you may like.</p>|and feel free to share any files you may like.</p>\r\n\t\t\t\t<p>Windows Shares now available! Browse to \\piratebox.lan\Shared\ in from a folder to access!</p>\r\n|' /opt/piratebox/www/index.html

That's pretty much it. Unfortunately, this will allow anyone to delete/create/move/whatever from the samba shares, which is not ideal. I don't think there's a way to prevent that, so I'm just going to go with how it is for now, and see what happens.
Re: How to install samba
November 05, 2015 05:48AM
unfortunately, running "opkg -d ext install samba36-server" returns "* opkg_install_cmd: Cannot install samba36-server" every time I try it. I'm online, I've run opkg update first, and I ping'd google to make sure it was online. It's also not there when I try "opkg list".

You've got me excited, any ideas? what am I doing wrong here?
Re: How to install samba
November 05, 2015 06:10AM
You've certainly got me interested. but unfortunately every time I try "opkg -d ext install samba36-server" , I get this

Unknown package 'samba36-server'.
Collected errors:
* opkg_install_cmd: Cannot install package samba36-server.

Is there something I need to do first? (something out of date I need to install/update perhaps?)

anyway thank you for your help, it took me a while to notice it but I was very excited when I read your post!
Re: How to install samba
November 05, 2015 06:12AM
Sorry for the double-post
Re: How to install samba
November 05, 2015 07:33AM
<edit> after playing around with it a while I decided to download the package myself, transfer it to my USB drive, install it manually, and then continue following your directions.

THANK YOU VERY MUCH, IT WORKS FLAWLESSLY!!

Thank you VERY much for helping me get this going, I think this deserves a place on the modifications page so more people can utilize this feature!

Thank you very much tehsnarf! I would've been wracking my brain forever trying to piece all that together from what I've been able to find online.
Re: How to install samba
January 31, 2017 05:47AM
Hello,

@Andrew B,

Just wanna ask where did you download the file for samba-36 server. It seems that it's not already available on the openwrt site. I reallly want to install this.

Thank you.

Snipy
Re: How to install samba
February 01, 2017 03:39AM
Andrew B. Wrote:
-------------------------------------------------------
> after playing around with it a while I decided to
> download the package myself, transfer it to my USB
> drive, install it manually, and then continue
> following your directions.
>
> THANK YOU VERY MUCH, IT WORKS FLAWLESSLY!!
>
> Thank you VERY much for helping me get this
> going, I think this deserves a place on the
> modifications page so more people can utilize this
> feature!
>
> Thank you very much tehsnarf! I would've been
> wracking my brain forever trying to piece all that
> together from what I've been able to find online.

Hello,

@Andrew B,

Just wanna ask where did you download the file for samba-36 server. It seems that it's not already available on the openwrt site. I reallly want to install this.

Thank you.

Snipy