Creating a "layman's" configuration instruction for samba

Hey gang,

One of the things I get frustrated with is the advanced level of instruction/description/acronym use when setting up new firmware. Most of us do not need a comprehensive document of every nuance of the firmware, just the basic setup instructions. For example, if I wanted to install a hard drive to my WRT1900AC (v.1) router, looking at the Samba documentation is as bad as reading Chinese. I have tried numerous times but cannot see my connected hard drive on the network at all.
Most instructions can be set up as simple bulleted instructions with maybe a link to a visual picture, but please create a "simplified" install and setup instructional. You will get more people using this if you do.


Sorry about that, I imported that page but then forgot to actually rewrite it into something useful.

I'm posting here a simple tutorial based on what I did right now to install and configure Samba in my LEDE test VM (that works the same as a real device as far as Samba is concerned), if you confirm that it is also working on your side and you can follow it, I'm cloning it in the wiki.

These instructions will create an "anonymous share", a shared folder with no password asked where everyone can write and read files, for more complex setups with access control I'd need to add more users and stuff like talked about in the wiki.

-install samba server package opkg update && opkg install samba36-server

-see current config of samba uci show samba


-adding new configuration for a share that is read-write, can be read/written only by the owner, is called "myshare", shares the contents of folder "/mnt", and does not ask for password (this is the explanation of each option below)

uci add samba sambashare 
uci set samba.@sambashare[0].read_only='no' 
uci set samba.@sambashare[0].create_mask='0660' 
uci set samba.@sambashare[0].dir_mask='0771' 
uci set samba.@sambashare[0].name='myshare' 
uci set samba.@sambashare[0].path='/mnt' 
uci set samba.@sambashare[0].guest_ok='yes' 

-check that these were loaded correctly by writing uci changes, this is my output, yours will have a different config key, but the readable text should be the same


-save changes with uci commit (or edit them to correct mistakes with uci set samba.cfg04e23c.something='something')

-enable samba service (so it is started on boot) and start it now service samba enable && service samba start

-and now set read/write permissions to the shared folder chmod 0777 /mnt

I can now see the shared folder "myshare" from a Windows 10 system and add/modify files in it as normal.

If you also need instructions to actually format and mount the hard drive so it is also remounted automatically on startup, I'll write also that.

1 Like

Ok. Will give it a spin.
Hopefully windows 10 will allow me to access it. Haven't been lucky
lately..either with LEDE or FreeNAS

Yes please...Everything.
I know the thought is to have everyone learn CLI, but I just don't have the
time. And I worry about the native Linksys firmware having either security
holes or back doors.
With ongoing cyber security attacks from Russia, China and others, I just
want to have the latest kernel with best possible defenses.

Thanks for the time into this


If I may...When instructions are written, I was taught in my "Technical
Writing" class the instruction should be "written for the idiot."
I know it sounds disparaging, but it is not meant to. We also had
"experience people skip to page..." notations (or hyperlinks which can
help" for those with experience in programming with LEDE.
You will get such a boost in usage, if idiots (like me...), know how to
program it, define and use the features, and make it secure.
For example...

In the "Shared Directories," none of the field headers have a frame of
reference to me so I don't know what they mean. A roll-over pop defining
the field and what/how we need to enter would be extremely helpful...even
if it is only to the chapter/section of the Wiki. However, that may be
difficult if the Wiki changes. A layman's description pop up may be the
best way to do this, then "See WiKi, Samba"
Example..."Allowed users." Is that a number of people, or names of people,
or the categories of the people who use this share (i.e. wheel)?
Without simplicity, people will get frustrated and try something else.


Sorry, one more thing.
Are the instruction above for a eSATA attached storage and does LEDE
support RAID arrays?

Yes please...Everything.

I have written the "format and mount part" here

Yes, having a GUI or at least a helper script that just asks you questions and does things is better, I know.

I know the thought is to have everyone learn CLI, but I just don't have the

No, the thought is that CLI instructions work reliably on any device and will allow people to use LEDE at all.

When that part of the documentation is done and still none else (that can fix it) cares about having a decent webui, I will start looking at documenting (and fixing it if I can) the webinterface. I'm not a true dev, more like a long-time user that hopes LEDE can become more user-friendly than OpenWRT ever was.

As you may have noticed, the most you get from many luci webpages is just exposing the same variables you would set from command line, but without any help or automation or tutorial to guide you, which is quite frankly pointless.

Are the instruction above for a eSATA attached storage

Samba does not care of how the storage device is connected, so that part is the same.

The tutorial about "format and mount part" should also be the same if the first part about dmesg is passed successfully (i.e. if the firmware integrates the Sata drivers in the default image and thus recognizes correctly the drive, which should be the case as yours is not a device with low firmware storage space).
If it is not getting detected, I'll have to write also a "Legacy installation of Sata drivers" paragraph like you see for USB currently.

Btw, can you post the message you see when you write dmesg in the first step? So I can show an example of Sata dmesg in the tutorial too.

does LEDE support RAID arrays?

Yes, but it is CLI-only.
You need to install mdadm package, and then configure RAID with it manually like you would do with any other Linux distro.
I wrote a tutorial for Debian here, to give you an idea of what would be likely needed, Probably it does not work as-is and it will need some minor adjustments for LEDE.


[quote="metropetro, post:8, topic:868, full:true"]WHY CAN I NOT GET THE ABILITY TO DEPOSIT FILES ON THE HARD DRIVE!!![/quote]There is no shared directory set in that screenshot, so I assume files have nowhere to go.

Click on the ADD button and add the path you have mounted the drive in (if you did mount the drive at all).

Did you follow my tutorial(s) from CLI? They work fine.

If I have read your help two hours earlier it really would have helped me ;- )

Thanks anyway @bobafetthotmail !

Would something like this have helped?

1 Like

I'm looking into getting this help text into the code base in this issue:
Update: The change is in pull request:

1 Like

The wrt's config Page was good but everyone suffering with the lede samba menu. I don't know there are many binary needed to make user/account, but they don't exist in lede; if you use those command; bash will tell you that they don't exist.

That;s close enough for me.. Just wanted to say Thanks for the updated / clarified instructions, they definitely help.

I know, openwrt is better documented. However I managed to get work. but every one can read and write. I want user level permission ACL.

here is conf summary
but there is no useradd binary in LEDE samba should install this binary, where I am gona get this binary.

@kdm6389 The 'shadow-utils' package contains the useradd binary. Use 'opkg update' and 'opkg install shadow-utils' from an SSH prompt to install this package.

Note that some LEDE firmware images include the adduser binary. This light-weight version provides similar functionality to the useradd binary.

adduser is only available if you compile Busybox with the custom options and include the it into the configuration. To do so, go into 'make menuconfig' -> 'Base system' -> 'busybox' -> 'Customize busybox options' -> 'Login/Password Management Utilities' and include 'adduser' as a built-in component.

1 Like

Now, I found that I dont need adduser binary, since it does modify /etc/passwd and /etc/group which i can edit too using vi.
The new lede samba setup guide contain all the details.

Hi I installed LEDE on my Tp link c2600, and was hoping it includes some frequently used features like bandwidth tracking, usb sharing... but it seems I have to install them individually.

I was able to install the bandwidthd package and make it to work.

But I am struggling with samba. I do not understand why I need to add share to a folder, why cannot set it to access the whole USB drive?
Why do I need to "Create a partition on the USB disk"? Suppose my USB is already formatted and contains lots of files, I would assume it is a normal expectation that I can simply plug in the USB and then I can read the contents on my PC, Phone, etc.

Thanks but this is hard for users without any experience.

mount your usb to /mnt/sdXYshare and share it samba