顯示頁面 舊版 反向連結 本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。 ====== samba ====== ====== install ====== <code> pkg install samba42 sysrc samba_server_enable="YES" </code> ====== config ====== /usr/local/etc/smb4.conf <code> [global] workgroup = WORKGROUP server string = CSNA Server netbios name = csna wins support = Yes security = user passdb backend = tdbsam [public] path = /home/public writable = yes browsable = yes read only = no guest ok = yes create mask = 0644 directory mask = 0755 hosts allow = 140.116.0.0/255.255.0.0 [homes] path = /home/%U writable = yes browsable = yes read only = no guest ok = no create mask = 0644 directory mask = 0755 hosts allow = 140.116.0.0/255.255.0.0 </code> ====== public share ====== user has all permission on his/her own file, but can not delete others. <code> mkdir /home/public chmod 3777 /home/public </code> ====== start service ====== <code> service samba_server start </code> ====== add samba user account ====== <code> smbpasswd -a CSNA2016 </code> ====== mount ====== <code> sudo mount -t cifs -o vers=3.0,username=${USER},password=${PASSWORD},uid=$(id -u),gid=$(id -g) //server-address/folder /mount/path/on/ubuntu sudo mount -t cifs -o vers=3.0,username=${USER},password=${PASSWORD},uid=$(id -u),gid=$(id -g),forceuid,forcegid, //server-address/folder /mount/path/on/ubuntu </code> ====== List shares ====== <code> smbclient -L ip_of_net_interface -U your_user_name </code>