ksmbd

KSMBD is a server which implements SMB3 protocol in kernel space for sharing files over your network. It can be used as a Samba alternative.

To use KSMBD install the ksmbd-server package.

The UCI configuration file is located at /etc/config/ksmbd. To edit in LuCI install the luci-app-ksmbd package.

Some options are hardcoded in the /etc/ksmbd/smb.conf.template.

Assume you have configured two block devices for use on your device: an SSD on /mnt/sda1 and a harddrive on /mnt/sdb1 (these are standard OpenWrt mounting points). Make sure to also install the filesystem your drive is formatted to, in LuCI filter System → Software for “kmod-fs”.

In this example we will access this storage anonymously over the LAN using the nobody/nogroup user, so we first assign ownership for all files and directories at these mounting points to that user:

chown -R nobody:nogroup /mnt/sda1 /mnt/sdb1

Then we can configure our shares in /etc/config/ksmbd like this:

config globals
	option workgroup 'WORKGROUP'
	option description 'Ksmbd on My-Device'
	option interface 'lan'

config share
	option name 'ssd'
	option path '/mnt/sda1'
	option read_only 'no'
	option guest_ok 'yes'
	option create_mask '0666'
	option dir_mask '0777'

config share
	option name 'harddisk'
	option path '/mnt/sdb1'
	option read_only 'no'
	option guest_ok 'yes'
	option create_mask '0666'
	option dir_mask '0777'

The globals section contains share-independent options.

Name Type Required Default Description
workgroup string no WORKGROUP Workgroup name
description string no Ksmbd on OpenWrt Server description
allow_legacy_protocols boolean no 0 Enables support for insecure versions of SMB3 protocol
Name Type Required Default Description
name string yes (none) Share name that will be displayed in a file browser
path string yes (none) Directory path
comment string no (none)
users string no (none)
create_mask number no (none) chmod mask for created files
dir_mask number no (none) chmod mask for created directories
browseable string no (none)
read_only string no (none)
writeable string no (none)
guest_ok string no (none)
force_root boolean no (none)
write_list string no (none)
read_list string no (none)
users string no (none)
hide_dot_files string no (none)
veto_files string no (none)
inherit_owner string no (none)
force_create_mode string no (none)
force_directory_mode string no (none)
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2024/01/24 19:38
  • by palebloodsky