確認是否安裝 samba
dpkg --list |grep samba
--> 出現 rc 表未安裝,出現 ii 表已安裝

安裝 samba
apt-get install samba

smpasswd -參數 username
-a 新增使用者
-x 刪除使用者
-d 停止使用者登入權限
-e 恢復使用者登入權限
-n 使用者不需密碼即可登入
---> 需在 /etc/samba 中的 [global] 加入 null passwords =yes

修改網芳上的顯示主機名稱
修改 /etc/samba/smb.conf
server string = %h server(Samba, Ubuntu) 改為
server string = Application
netbios name = Server1

---> Application 為顯示註解名稱,Server1 為網芳主機名稱

讓本機用戶可登入,並可存取自己的根目錄
修改 /etc/samba/smb.conf
#map to guest = bad user
#usershare allow guests = yes

修改 [home]
將;拿掉
[homes]
 comment = Home Directories
 browseable = no
 writable = yes  ---> 加入寫入權限

增加所有使用者都可寫入的公用目錄
[home] 設定最後加入

[tmp]
 comment = Temporary file space
   path = /tmp
   read onlo = no
   public = yes

所有使用者可閱讀,只限特定群組成員才能寫入
groupadd -g 1001 super  --> 增加一個群組 super
gpasswd -a superman super  --> 將 superman 加入群組 super
mkdir /data  --> 增加一個目錄 /data
chmod -R 755 /data/ --> 修改 /data 權限
chown -R root:super /data/

修改 smb.conf
[public]
 comment = Public Stuff
   path = /data
   public = yes
   writable =yes
   printable = no
   write list = @super

重新啟動 SMB 的服務
/etc/init.d/samba restart

arrow
arrow
    全站熱搜

    莊子 發表在 痞客邦 留言(0) 人氣()