sudo apt-get update sudo apt-get install samba2. 修改samba設定檔
nano /etc/samba/smb.conf
[global] ## Browsing/Identification ### # Change this to the workgroup/NT-domain name your Samba server will part of workgroup = WORKGROUP security = user # 最小支援的SMBv2版本 min protocol = SMB2 # server string is the equivalent of the NT Description field server string = %h server (Samba, Ubuntu) #### Networking #### # The specific set of interfaces / networks to bind to # This can be either the interface name or an IP address/netmask; # interface names are normally preferred ; interfaces = 127.0.0.0/8 eth0 interfaces = 127.0.0.0/8 192.168.0.0/16
# Cap the size of the individual log files (in KiB). ; max log size = 1000 max log size = 100
#======================= Share Definitions ======================= [root] comment = Root Directories path = / writeable = yes browseable = yes valid users = root [www] comment = www path = /var/www writeable = yes browseable = yes valid users = root # Un-comment the following (and tweak the other settings below to suit) # to enable the default home directory shares. This will share each # user's home directory as \\server\username並把以下註解掉
;[printers] ; comment = All Printers ; browseable = no ; path = /var/spool/samba ; 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 = no3. 重啟 samba 服務
sudo systemctl restart smbd nmbd4. 建立 Samba 使用者
sudo smbpasswd -a root其他相關用法
若有修改設定檔 smb.conf,讓 samba 重新載入設定檔,可以使用以下指令,不需重啟 samba 服務
sudo systemctl reload smbd nmbd檢查設定檔是否有誤
testparm查看 samba 連線狀態
sudo smbstatus
沒有留言:
張貼留言