§2023-07-09

  1. Install
$ sudo pacman -S samba

$ systemctl status samba
○ samba.service - Samba AD Daemon
     Loaded: loaded (/usr/lib/systemd/system/samba.service; disabled; preset: disabled)
     Active: inactive (dead)
       Docs: man:samba(8)
             man:samba(7)
             man:smb.conf(5)
  1. ¶ /etc/samba/smb.conf as
global]
        # printcap name=cups
        # winbind enum groups=yes
        # include=/var/tmp/nginx/smb.netbios.aliases.conf
        security=user
        local master=no
        realm=*
        passdb backend=smbpasswd
        printing=cups
        max protocol=SMB2
        winbind enum users=yes
        # load printers=yes
        workgroup = orangepi5.yushei.net 

[alexlaiHome]
       path = /opt/xfs//home/alexlai
       valid users = alexlai
       read only = no
       create mask = 0777
  1. Add user sudo smbpasswd -a alexlai

  2. start with systemctl start smb

$ sudo systemctl status  smb
● smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; disabled; preset: disabled)
     Active: active (running) since Sun 2023-07-09 10:30:20 CST; 5min ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 23853 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 9 (limit: 18692)
     Memory: 34.1M
        CPU: 2.653s
     CGroup: /system.slice/smb.service
             ├─23853 /usr/bin/smbd --foreground --no-process-group
             ├─23855 "smbd: notifyd "
             ├─23856 "smbd: cleanupd"
             ├─23928 "smbd: client [192.168.48.133]"
             ├─23931 /usr/lib/samba/samba/samba-dcerpcd --libexec-rpcds --ready-signal-fd=29 --np-helper --debuglevel=0
             ├─23941 /usr/lib/samba/samba/rpcd_classic --configfile=/etc/samba/smb.conf --worker-group=7 --worker-index=0 --debuglevel=0
             ├─23943 /usr/lib/samba/samba/rpcd_winreg --configfile=/etc/samba/smb.conf --worker-group=6 --worker-index=5 --debuglevel=0
             ├─23945 /usr/lib/samba/samba/rpcd_lsad --configfile=/etc/samba/smb.conf --worker-group=3 --worker-index=0 --debuglevel=0
             └─23948 /usr/lib/samba/samba/rpcd_mdssvc --configfile=/etc/samba/smb.conf --worker-group=4 --worker-index=0 --debuglevel=0

 7月 09 10:30:20 orangepi5 systemd[1]: Starting Samba SMB Daemon...
 7月 09 10:30:20 orangepi5 smbd[23853]: [2023/07/09 10:30:20.338251,  0] ../../source3/smbd/server.c:1746(main)
 7月 09 10:30:20 orangepi5 smbd[23853]:   smbd version 4.18.2 started.
 7月 09 10:30:20 orangepi5 smbd[23853]:   Copyright Andrew Tridgell and the Samba Team 1992-2023
 7月 09 10:30:20 orangepi5 systemd[1]: Started Samba SMB Daemon.
  1. Try to coonect from MacOS,

  2. enable it,