1. 程式人生 > >ubuntu16.04 搭建samba環境

ubuntu16.04 搭建samba環境

ubuntu16.04 搭建samba環境

安裝

  • 下載samba
[email protected]:/home# apt-get install samba
[email protected]:/home# service smb start
  • 修改配置檔案

具體每一項的含義,smb.conf內有說明,需要了解的,稍微看一下就明白;按照我的步驟進行,親測有效

[email protected]:/home# vim /etc/samba/smb.conf 
[share]
comment = Share Folder require password
browseable = yes
path = /home/share
create mask = 0777
directory mask = 0777
valid users = share
force user = nobody
force group = nogroup
public = yes
writable = yes
available = yes
  • 重啟samba服務
[email protected]:/home# /etc/init.d/samba restart
Restarting nmbd (via systemctl): nmbd.service.
Restarting smbd (via systemctl): smbd.service.
Restarting samba-ad-dc (via systemctl): samba-ad-dc.service
  • 建立共享目錄
mkdir /home/share
chmod -R 777 /home/share
  • 建立新使用者
sudo groupadd share -g 6000
sudo useradd share -g 6000 -s /shin/nologin -d /dev/null
smbpasswd -a share //設定一下密碼即可

以上操作,就配置好了samba伺服器了,可以在windows上建立一個磁碟對映,方便今後工作使用。