{ "version": "https://jsonfeed.org/version/1.1", "user_comment": "This feed allows you to read the posts from this site in any feed reader that supports the JSON Feed format. To add this feed to your reader, copy the following URL -- https://matoken.org/blog/tag/ksmbd/feed/json -- and add it your reader.", "home_page_url": "https://matoken.org/blog/tag/ksmbd", "feed_url": "https://matoken.org/blog/tag/ksmbd/feed/json", "language": "ja", "title": "KSMBD – matoken's blog", "description": "Is there no plan B?", "icon": "https://matoken.org/blog/wp-content/uploads/2025/03/cropped-1865f695c4eecc844385acef2f078255036adccd42c254580ea3844543ab56d9.jpeg", "items": [ { "id": "https://matoken.org/blog/?p=4274", "url": "https://matoken.org/blog/2024/12/13/smb-share-with-ksmbd/", "title": "KSMBD\u3067SMB\u5171\u6709", "content_html": "
Android\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u304b\u3089Linux Box\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3044\uff0eAndroid\u304b\u3089\u3060\u3068SMB\u304c\u3044\u3044\u306e\u304b\u306a?\u3067\u3082\u4eca\u56de\u306b\u7528\u9014\u306bsamba\u306f\u5927\u8888\u88df\u306a\u611f\u3058\u3068\u3044\u3046\u3053\u3068\u3067\u4e45\u3005\u306bKSMBD\u3092\u8a2d\u5b9a\u3057\u305f\u30e1\u30e2\u3067\u3059\uff0e
\n\n
\u30db\u30b9\u30c8\u306fRaspberry Pi bookworm armhf\u3068Debian sid amd64\u3067\u78ba\u8a8d\u3057\u307e\u3057\u305f\uff0e
\nKSMBD\u306fLinux Kernel\u30d9\u30fc\u30b9\u306eSMB\u30b5\u30fc\u30d0\u30fc\u5b9f\u88c5\u3067\u3059\uff0eLinux kernel 5.11\u4ee5\u964d\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\uff0e
samba\u3092\u52d5\u304b\u3057\u3066\u3044\u308b\u5834\u5408\u505c\u6b62\u3057\u307e\u3059\uff0e
\n$ sudo systemctl stop smbd nmbd winbind samba-ad-dc\n
KSMBD\u81ea\u4f53\u306fkernel module\u3067\u3059\u304c\uff0c\u30e6\u30fc\u30b6\u30e9\u30f3\u30c9\u306eksmbd-tools\u3068\u3044\u3046\u30c4\u30fc\u30eb\u304c\u5225\u9014\u5fc5\u8981\u306a\u306e\u3067\u5c0e\u5165\u3057\u307e\u3059\uff0e
\nDebian\u3067\u306f ksmbd-tools \u3068\u3044\u3046\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3059\uff0e
$ sudo apt install ksmbd-tools\n$ dpkg -L ksmbd-tools\n/.\n/etc\n/etc/ksmbd\n/etc/ksmbd/ksmbd.conf.example\n/usr\n/usr/lib\n/usr/lib/systemd\n/usr/lib/systemd/system\n/usr/lib/systemd/system/ksmbd.service\n/usr/libexec\n/usr/libexec/ksmbd.tools\n/usr/sbin\n/usr/share\n/usr/share/doc\n/usr/share/doc/ksmbd-tools\n/usr/share/doc/ksmbd-tools/PFIF.txt\n/usr/share/doc/ksmbd-tools/README.Debian\n/usr/share/doc/ksmbd-tools/README.md.gz\n/usr/share/doc/ksmbd-tools/changelog.Debian.gz\n/usr/share/doc/ksmbd-tools/copyright\n/usr/share/doc/ksmbd-tools/examples\n/usr/share/doc/ksmbd-tools/examples/ksmbd.conf.example\n/usr/share/man\n/usr/share/man/man5\n/usr/share/man/man5/ksmbd.conf.5.gz\n/usr/share/man/man5/ksmbdpwd.db.5.gz\n/usr/share/man/man8\n/usr/share/man/man8/ksmbd.addshare.8.gz\n/usr/share/man/man8/ksmbd.adduser.8.gz\n/usr/share/man/man8/ksmbd.control.8.gz\n/usr/share/man/man8/ksmbd.mountd.8.gz\n/usr/sbin/ksmbd.addshare\n/usr/sbin/ksmbd.adduser\n/usr/sbin/ksmbd.control\n/usr/sbin/ksmbd.mountd\n
\u6b21\u306b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u610f\u3057\u307e\u3059\uff0e
\n$ echo '[global]\n\n[share]\n path=/tmp\n' | sudo tee /etc/ksmbd/ksmbd.conf\n
$ sudo cp -p /etc/samba/smbd.conf /etc/ksmbd/ksmbd.conf\n
$ sudo cp -p /etc/ksmbd/ksmbd.conf.example /etc/ksmbd/ksmbd.conf\n
smb.conf\u3068\u3060\u3044\u305f\u3044\u540c\u3058\u3088\u3046\u306b\u304b\u3051\u307e\u3059\u304c\uff0c[homes]\u306e\u3088\u3046\u306a\u7279\u6b8a\u306a\u5171\u6709\u540d\u3084\uff0cpath = %H \u3084 path = /home/%u \u306e\u3088\u3046\u306a\u74b0\u5883\u5909\u6570\u306f\u3046\u307e\u304f\u52d5\u304b\u306a\u3044\u611f\u3058\u3067\u3059\uff0e\u4ee5\u4e0b\u306e\u3088\u3046\u306aissue\u304c\u3042\u308b\u306e\u3067\u6050\u3089\u304f\u672a\u5b9f\u88c5\u304b\u306a\u3068\uff0e
\u8a73\u7d30\u306fKSMBD.CONF(5)\u3092\uff0e
\n$ man ksmbd.conf\n
ksmbd-tools\u4ed8\u5c5e\u306eksmbd.adduser\u30b3\u30de\u30f3\u30c9\u3067\u5171\u6709\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306e\u30e6\u30fc\u30b6\u540d\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\uff0e
\n$ sudo ksmbd.adduser -a <KSMBD\u30a2\u30af\u30bb\u30b9\u7528\u30e6\u30fc\u30b6\u540d>\n
\u30d1\u30b9\u30ef\u30fc\u30c9\u30d5\u30a1\u30a4\u30eb\u306f /etc/ksmbd/ksmbdpwd.db \u3067\uff0c ID:passwordhash \u306e\u3088\u3046\u306a\u5f62\u5f0f\u3067\u4fdd\u5b58\u3055\u308c\u308b\u3088\u3046\u3067\u3059\uff0e
KSMBD\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\uff0e\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u306a\u3044\u5834\u5408kernel source\u304b\u3089menuconfig\u306a\u3069\u3067KSMBD\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u6709\u52b9\u306b\u3057\u307e\u3059\uff0e
\n$ modinfo ksmbd\nfilename: /lib/modules/6.6.64-v7+/kernel/fs/smb/server/ksmbd.ko.xz\nsoftdep: pre: crc32\nsoftdep: pre: gcm\nsoftdep: pre: ccm\nsoftdep: pre: aead2\nsoftdep: pre: sha512\nsoftdep: pre: sha256\nsoftdep: pre: cmac\nsoftdep: pre: aes\nsoftdep: pre: nls\nsoftdep: pre: md5\nsoftdep: pre: hmac\nsoftdep: pre: ecb\nlicense: GPL\ndescription: Linux kernel CIFS/SMB SERVER\nversion: 3.4.2\nauthor: Namjae Jeon <linkinjeon@kernel.org>\nsrcversion: 615D8D4CE63537A48C03456\ndepends: nls_ucs2_utils,cifs_arc4\nintree: Y\nname: ksmbd\nvermagic: 6.6.64-v7+ SMP mod_unload modversions ARMv7 p2v8\n$ sudo modprobe -v ksmbd\n$ lsmod | grep ksmbd\nksmbd 249856 1\ncifs_arc4 12288 1 ksmbd\nnls_ucs2_utils 12288 1 ksmbd\n
\u30e6\u30fc\u30b6\u30fc\u7a7a\u9593\u7528\u306e\u30c7\u30fc\u30e2\u30f3\u3092\u8d77\u52d5\u3057\u307e\u3059\uff0e
\n$ sudo ksmbd.mountd\n
\u9069\u5f53\u306a\u30d5\u30a1\u30a4\u30e9\u30fc\u3084\uff0csmbclient\u306a\u3069\u304b\u3089\u30a2\u30af\u30bb\u30b9\u51fa\u6765\u308b\u306e\u3092\u78ba\u8a8d\u3057\u307e\u3059\uff0e
\n$ smbclient //192.168.0.23/home\nPassword for [WORKGROUP\\matoken]:\nTry \"help\" to get a list of possible commands.\nsmb: \\> ls\n . D 0 Tue Nov 17 06:17:29 2020\n .. D 0 Mon May 20 18:03:24 2024\n nitter D 0 Mon Nov 23 23:14:29 2020\n huginn D 0 Sat Oct 24 16:03:31 2020\n pi D 0 Mon Aug 12 06:12:17 2024\n matoken D 0 Thu Dec 12 22:39:12 2024\n gitea D 0 Fri Nov 13 09:43:48 2020\n\n 29948557 blocks of size 4096. 2499637 blocks available\n
\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3057\u305f\u5834\u5408\uff0c\u8a2d\u5b9a\u3092\u53cd\u6620\u3059\u308b\u305f\u3081\u306b\u518d\u8aad\u8fbc\u3092\u3057\u307e\u3059\uff0e
\n$ sudo ksmbd.control --reload\n
$ sudo ksmbd.control -s\n[ksmbd.control/30908]: INFO: Terminated ksmbd.mountd\n[ksmbd.control/30908]: INFO: Killed ksmbd\n$ sudo modprobe -r ksmbd\n
\u52d5\u3044\u305f\u306e\u3067\u6b21\u56de\u8d77\u52d5\u6642\u4ee5\u964d\u306b\u8d77\u52d5\u3057\u3066\u304f\u308b\u3088\u3046\u6c38\u7d9a\u5316\u3057\u307e\u3059\uff0e
\n$ sudo systemctl disable smbd nmbd winbind samba-ad-dc\n
$ echo ksmbd | sudo tee -a /etc/modules\n
$ sudo systemctl enable ksmbd\n
\u518d\u8d77\u52d5\u3057\u3066\u52d5\u4f5c\u78ba\u8a8d\uff0e
\n\u307e\u305aSMB\u306b\u5bfe\u5fdc\u3057\u305f\u52d5\u753b\u30d7\u30ec\u30a4\u30e4\u30fc\u306eVLC\u3067\u52d5\u753b\u518d\u751f\u3092\u8a66\u307f\u307e\u3057\u305f\uff0e\u554f\u984c\u306a\u304f\u52d5\u4f5c\u3057\u307e\u3059\uff0e
\n\u6b21\u306bPDF\u3092\u8aad\u3081\u308b\u304b\u8a66\u305d\u3046\u3068\u601d\u3063\u305f\u306e\u3067\u3059\u304c\uff0cFiles\u30a2\u30d7\u30ea\u306a\u3069\u3067\u306fSMB\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u305d\u3046\u3067\u3059\uff0eF-Droid\u304b\u3089CIFS Documents Provider\u3068\u3044\u3046\u30a2\u30d7\u30ea\u30b1\u30b7\u30e7\u30f3\u3092\u5c0e\u5165\u3059\u308b\u3053\u3068\u3067SMB\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3057\u305f\uff0ePDF\u30d5\u30a1\u30a4\u30eb\u3082\u8aad\u3081\u307e\u3059\uff0e\u3057\u304b\u3057\u4e00\u65e6\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u306a\u3044\u3068\u8aad\u3081\u306a\u3044\u3088\u3046\u3067\u5c11\u3057\u5f85\u3061\u6642\u9593\u304c\u5fc5\u8981\u3067\u3057\u305f\uff0e\u63a2\u305b\u3070\u30b9\u30c8\u30ea\u30fc\u30df\u30f3\u30b0\u306b\u5bfe\u5fdc\u3057\u305f\u30a2\u30d7\u30ea\u306f\u3042\u308a\u305d\u3046\u3067\u3059\uff0e
\n\u5bb6\u5ead\u5185\u306e\u500b\u4eba\u7528\u30d5\u30a1\u30a4\u30eb\u30b5\u30fc\u30d0\u30fc\u306a\u3093\u304b\u3060\u3068KSMBD\u304c\u5411\u3044\u3066\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff0e
\n$ uname -a\nLinux raspberrypi 6.6.64-v7+ #1829 SMP Tue Dec 10 20:04:50 GMT 2024 armv7l GNU/Linux\n$ apt list ksmbd-tools\nListing... Done\nksmbd-tools/stable,now 3.4.7-1 armhf [installed]\n$ lsb_release -dr\nNo LSB modules are available.\nDescription: Raspbian GNU/Linux 12 (bookworm)\nRelease: 12\n$ arch\narmv7l\n$ grep \"^Model\" /proc/cpuinfo\nModel : Raspberry Pi 3 Model B Rev 1.2\n
$ uname -a\nLinux tp-l13 6.11.10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.11.10-1 (2024-11-23) x86_64 GNU/Linux\n$ apt list ksmbd-tools\nksmbd-tools/unstable,now 3.5.2-3 amd64 [installed]\n$ lsb_release -dr\nDescription: Debian GNU/Linux trixie/sid\nRelease: n/a\n$ arch\nx86_64\n
$ adb shell pm list packages --show-versioncode | grep -e vlc -e cifs\npackage:com.wa2c.android.cifsdocumentsprovider versionCode:29\npackage:org.videolan.vlc versionCode:13050749\n$ adb shell getprop ro.build.version.release\n14\n$ adb shell getprop ro.product.model\nmoto g24\n