root@ubuntu24:~# cat /etc/default/samba NMBDOPTIONS= SMBDOPTIONS= root@ubuntu24:~# ================================================ root@ubuntu24:~# cat /etc/samba/smbusers test01 = test localuser1 root@ubuntu24:~# ================================================ root@ubuntu24:~# diff -u /etc/samba/smb.conf.org /etc/samba/smb.conf --- /etc/samba/smb.conf.org 2025-02-09 10:00:22.388077042 +0900 +++ /etc/samba/smb.conf 2025-02-09 15:09:02.732242347 +0900 @@ -26,7 +26,7 @@ ## Browsing/Identification ### # Change this to the workgroup/NT-domain name your Samba server will part of - workgroup = WORKGROUP + workgroup = SMBGROUP # server string is the equivalent of the NT Description field server string = %h server (Samba, Ubuntu) @@ -54,7 +54,7 @@ log file = /var/log/samba/log.%m # Cap the size of the individual log files (in KiB). - max log size = 1000 + max log size = 50 # We want Samba to only log to /var/log/samba/log.{smbd,nmbd}. # Append syslog@1 if you want important messages to be sent to syslog too. @@ -88,7 +88,8 @@ # parameters must be set (thanks to Ian Kahan < for # sending the correct chat script for the passwd program in Debian Sarge). passwd program = /usr/bin/passwd %u - passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . +# passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . + passwd chat = *new*password* %n\n *new*password* %n\n *successfully* # This boolean controls whether PAM will be used for password changes # when requested by an SMB client instead of the program listed in @@ -97,7 +98,7 @@ # This option controls how unsuccessful authentication attempts are mapped # to anonymous connections - map to guest = bad user + map to guest = Never ########## Domains ########### @@ -167,6 +168,11 @@ # public shares, not just authenticated ones usershare allow guests = yes +dos charset = CP932 +load printers = no +disable spoolss = yes +username map = /etc/samba/smbusers + #======================= Share Definitions ======================= # Un-comment the following (and tweak the other settings below to suit) @@ -216,23 +222,23 @@ ; create mask = 0600 ; directory mask = 0700 -[printers] - comment = All Printers - browseable = no - path = /var/tmp - printable = yes - guest ok = no - read only = yes - create mask = 0700 +;[printers] +; comment = All Printers +; browseable = no +; path = /var/tmp +; printable = yes +; guest ok = no +; read only = yes +; create mask = 0700 # Windows clients look for this share name as a source of downloadable # printer drivers -[print$] - comment = Printer Drivers - path = /var/lib/samba/printers - browseable = yes - read only = yes - guest ok = no +;[print$] +; comment = Printer Drivers +; path = /var/lib/samba/printers +; browseable = yes +; read only = yes +; guest ok = no # Uncomment to allow remote administration of Windows print drivers. # You may need to replace 'lpadmin' with the name of the group your # admin users are members of. @@ -240,3 +246,17 @@ # to the drivers directory for these users to have write rights in it ; write list = root, @lpadmin +[Share] +comment = Share Folder for All Users +path = /home/share +browsable = yes +read only = no + +[Share-only] +comment = itibu Users +path = /home/share-only +browsable = yes +read only = yes +write list = @ok +hosts allow = 172.16.3.0/255.255.255.0 +valid users = @ok root@ubuntu24:~#