安裝Samba
- rpm -qa|grep samba
- yum install samba
關(guān)閉selinux和防火墻
- setenforce 0
- sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
- systemctl stop firewalld
- systemctl disable firewalld
啟動samba
- systemctl start smb
配置Samba服務(wù)
- cd /home/
- mkdir logger shared
- useradd -s /sbin/nologin logadmin
- useradd -g logadmin -s /sbin/nologin loguser
- useradd -s /sbin/nologin admin
- useradd -g admin -s /sbin/nologin shared
建立Samba用戶
- – smbpasswd -a logadmin
- – smbpasswd -a loguser
- – smbpasswd -a admin
- – smbpasswd -a shared
更改目錄屬性
- chown logadmin.logadmin logger
- chown admin.admin shared
- chmod -R 777 logger
- chmod -R 777 shared
查看Samba配置文件
samba文件共享默認(rèn)配置文件存放于/etc/samba/smb.conf下, 用于配置Samba服務(wù)內(nèi)容。
- [global]
- workgroup = SC.LOCAL
- server string = Samba Server Version %v
- netbios name = Linuxidc-Server
- log file = /var/log/samba/%m.log
- max log size = 10240
- security = user
- passdb backend = tdbsam
- [logger]
- comment = Logs Directories
- path = /home/logger/
- public = no
- admin users = logadmin
- valid users = @logadmin
- browseable = yes
- writable = yes
- create mask = 0777
- directory mask = 0777
- force directory mode = 0777
- force create mode = 0777
- [shared]
- # 共享文件目錄描述
- comment = Shared Directories
- # 共享文件目錄
- path = /home/shared/
- # 是否允許guest訪問
- public = no
- # 指定管理用戶
- admin users = admin
- # 可訪問的用戶組、用戶
- valid users = @admin
- # 是否瀏覽權(quán)限
- browseable = yes
- # 是否可寫權(quán)限
- writable = yes
- # 文件權(quán)限設(shè)置
- create mask = 0777
- directory mask = 0777
- force directory mode = 0777
- force create mode = 0777
修改完Samba配置文件后,需要重啟Samba服務(wù)配置才能生效
- systemctl restart smb
- systemctl status smb
get小知識:進(jìn)入cmd命令輸入
- C:\>net use * /del /y
斷開與samba服務(wù)的所有共享連接。
更多相關(guān)文章
版權(quán)聲明:文章圖片資源來源于網(wǎng)絡(luò),如有侵權(quán),請留言刪除!!!
評論