close
安裝 Samba
# apt-get update ... # apt-get install -y samba samba-common python-glade2 system-config-samba ...
# samba --version Version 4.3.11-Ubuntu
首先, 請用上述指令安裝 Samba. Samba 版本是 4.3.11 .
# dpkg -l |grep samba ii python-samba 2:4.3.11+dfsg-0ubuntu0.14.04.3 amd64 Python bindings for Samba ii samba 2:4.3.11+dfsg-0ubuntu0.14.04.3 amd64 SMB/CIFS file, print, and login server for Unix ii samba-common 2:4.3.11+dfsg-0ubuntu0.14.04.3 all common files used by both the Samba server and client ii samba-common-bin 2:4.3.11+dfsg-0ubuntu0.14.04.3 amd64 Samba common files used by both the server and the client ii samba-dsdb-modules 2:4.3.11+dfsg-0ubuntu0.14.04.3 amd64 Samba Directory Services Database ii samba-libs:amd64 2:4.3.11+dfsg-0ubuntu0.14.04.3 amd64 Samba core libraries ii samba-vfs-modules 2:4.3.11+dfsg-0ubuntu0.14.04.3 amd64 Samba Virtual FileSystem plugins ii system-config-samba 1.2.63-0ubuntu6 all GUI for managing samba shares and users #
設定 Samba 密碼
# smbpasswd -a jason New SMB password: Retype new SMB password: ... # smbpasswd -a root New SMB password: Retype new SMB password: ...
此例中 Samba 分享的使用者為 jason 以及 root .
備份 smb.conf
# cp -Rpf /etc/samba /etc/samba-original
編輯 smb.conf
# cat /etc/samba/smb.conf
# /etc/samba/smb.conf # Created Aug 18, 2014 # There MUST be a space around every equals sign. [global] workgroup = WORKGROUP #workgroup = OURDOMAIN.local ; browseable = yes # My Perl programs running via cron create files and the mode MUST be 0766 for those new files. create mode = 0776 writeable = yes guest ok = yes ################################### ; follow symlinks = yes wide links = yes unix extensions = no [home] path = /home valid users = jason, root force user = root force group = root admin users = root, jason writeable = yes ; browseable = yes [html] path = /var/www/html valid users = jason, root force user = root force group = root admin users = root, jason writeable = yes ; browseable = yes
此例中 Samba 分享的資料夾為 /home 以及 /var/www/html ; 使用者為 jason 以及 root .
資料夾的權限
# chmod 777 /home ... # mkdir -p /var/www/html # chmod 777 /var/www/html ...
Samba Server 可能會需要資料夾的權限 .
重啟 Samba 服務
# service smbd restart smbd stop/waiting smbd start/running, process 3036
If "starting smb/cifs file and active directory server fail"
# echo manual > /etc/init/samba-ad-dc.override
刪除已儲存的使用者名稱和密碼
C:\>rundll32.exe keymgr.dll, KRShowKeyMgr
Win7 檔案總管輸入 \\192.168.11.160
\\192.168.11.160
Email: jasonc@mail2000.com.tw
文章標籤
全站熱搜
留言列表