Centos6 samba服務配置

一、在阿里虛擬機中配置包源 
在ecs的 /etc/yum.repos.d 建立個 alios.repo,內容以下
[alios.$releasever.base.$basearch]
name=alios
gpgcheck=0
二、刪除多餘的文件,只遺留alios.repo
三、安裝samba
yum install samba samba-client -y
 
四、配置配置文件
$ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak  //備份配置文件
$ sudo  >smb.conf  //清空配置文件
$ sudo vim smb.conf
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = centos
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ==============================   
[django_project]
#分享目錄
path = /home/caideyang/Documents/project
browsable =yes
writable = yes
guest ok = yes
read only = yes
public = yes
#用戶
vaild users = caideyang
create mask = 0777
directory mask = 0777
#force user = nobody
#force group = nogroup
writable = yes
available = yes
 
五、建立用戶(前兩步防止用戶建立失敗)
groupadd wxwsmb
useradd -g wxwsmb caideyang
smbpasswd -a caideyang
 
七、建立須要分享的目錄
$ mkdir -p  /home/caideyang/Documents/project
 
四、重啓服務
service smb stop
service smb start
service nmb stop
service nmb start
service smb restart
 
八、修改分享目錄的權限
chmod -R 777 /home/caideyang/Documents/project
 
五、查看進程
ps -ef |grep smb
 
六、查看端口號
netstat -tnlp |grep smb
 
九、在Windows機器上設置
相關文章
相關標籤/搜索