CentOS7 3.10.0-957.el7.x86_64
--------------------------------------------------------------------------------------------------------
# yum -y install samba
# rpm -qa | grep samba
samba-client-libs-4.8.3-6.el7_6.x86_64
samba-common-tools-4.8.3-6.el7_6.x86_64
samba-common-4.8.3-6.el7_6.noarch
samba-common-libs-4.8.3-6.el7_6.x86_64
samba-libs-4.8.3-6.el7_6.x86_64
samba-4.8.3-6.el7_6.x86_64
# systemctl start smb.service
# systemctl enable smb.service
# systemctl status smb.service
# firewall-cmd --add-service=samba --permanent
# firewall-cmd --reload
# firewall-cmd --list-all
-------系統根目錄---- / 內-----------------------------
# mkdir /Smb
# ls -Z /
drwxr-xr-x. root root unconfined_u:object_r:default_t:s0 Smb
# chcon -R -t samba_share_t /Smb
# chmod 777 /Smb
# vi /etc/samba/smb.conf
...
[global]
workgroup = WORKGROUP
server string = Samba Server %v
security = user
map to guest = bad user
dns proxy = no
[Samba分享]
path = /Smb
browsable =yes
writable = yes
guest ok = yes
read only = no
# systemctl restart smb.service
\\192.168.1.9\Samba分享
-------使用者家目錄----/home 內-----------------------------
# useradd kk1
# passwd kk1
# mkdir /home/kk1/Smb
# ls -Z /home
drwx------. kk1 kk1 unconfined_u:object_r:user_home_dir_t:s0 kk1
# chmod 755 /home/kk1
# ls -Z /home
drwxr-xr-x. kk1 kk1 unconfined_u:object_r:user_home_dir_t:s0 kk1
# ls -Z /home/kk1
# vi /etc/samba/smb.conf
...
[global]
workgroup = WORKGROUP
server string = Samba Server %v
security = user
map to guest = bad user
dns proxy = no
[Samba分享]
path = /home/kk1/Smb
browsable =yes
writable = yes
guest ok = yes
read only = no
# systemctl restart smb.service
\\192.168.1.9\Samba分享
-----即可新增、刪除檔案
# firewall-cmd --add-service=samba --permanent
# firewall-cmd --reload
# firewall-cmd --list-all
-------系統根目錄---- / 內-----------------------------
# mkdir /Smb
# ls -Z /
drwxr-xr-x. root root unconfined_u:object_r:default_t:s0 Smb
# chcon -R -t samba_share_t /Smb
# chmod 777 /Smb
# ls -Z /
drwxrwxrwx. root root unconfined_u:object_r:samba_share_t:s0 Smb# vi /etc/samba/smb.conf
...
[global]
workgroup = WORKGROUP
server string = Samba Server %v
security = user
map to guest = bad user
dns proxy = no
[Samba分享]
path = /Smb
browsable =yes
writable = yes
guest ok = yes
read only = no
# systemctl restart smb.service
\\192.168.1.9\Samba分享
-------使用者家目錄----/home 內-----------------------------
# useradd kk1
# passwd kk1
# mkdir /home/kk1/Smb
# ls -Z /home
drwx------. kk1 kk1 unconfined_u:object_r:user_home_dir_t:s0 kk1
# chmod 755 /home/kk1
# ls -Z /home
drwxr-xr-x. kk1 kk1 unconfined_u:object_r:user_home_dir_t:s0 kk1
# ls -Z /home/kk1
drwxr-xr-x. root root unconfined_u:object_r:user_home_t:s0 Smb
# chcon -R -t samba_share_t /home/kk1/Smb
# chmod 777 /home/kk1/Smb
# ls -Z /home/kk1
drwxrwxrwx. root root unconfined_u:object_r:samba_share_t:s0 Smb
...
[global]
workgroup = WORKGROUP
server string = Samba Server %v
security = user
map to guest = bad user
dns proxy = no
[Samba分享]
path = /home/kk1/Smb
browsable =yes
writable = yes
guest ok = yes
read only = no
# systemctl restart smb.service
\\192.168.1.9\Samba分享
-----即可新增、刪除檔案
沒有留言:
張貼留言