linux下samba共享實現

yum install samba -y
mkdir /opt/share
chown -R nobody:nobody /opt/share
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
vim /etc/samba/smb.conf

[global]
        workgroup = SAMBA
        security = user
        map to guest = Bad User
        log file = /var/log/samba/log.%m

[public]
        comment = Public Stuff
        path = /opt/share
        public = yes
        read only = no
        deny hosts = 172.16.101.0/24

[文件共享]
        comment = Public Stuff
        path = /opt/share
        public = yes
        read only = yes
        deny hosts = 172.16.150.0/24

systemctl enable smb.service && systemctl start smb.service


yum install samba-client
smbclient -L //172.16.150.200/public
yum install cifs-utils
mount.cifs -p 4455 //172.16.150.200/public /opt/share/
unmount /opt/share
vim /etc/fstab
//172.16.150.200/public        /opt/share              cifs    guest,port=4455 0 0
mount -a

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章