yum install samba -y
===================
mkdir /smbtest/test -p
12 chmod 777 /smbtest/test -R
============================
vi /etc/samba/smb.conf
Global Settings
workgroup = workgroup
security = share
###################
# if need a password
###################
# security = user
# passdb backend = tdbsam
# useradd testuser
# smbpasswd -a testuser
# chown testuser:testuser /smbtest/test/ -R
#etc/init.d/smb restart
#/etc/init.d/nmb restart
####################
[test]
path = /smbtest/test
writable = yes
browsable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777
---------------------------------
---------------------------------
ip allow example
---------------------------------
[global]
workgroup = WORKGROUP
server string = Samba Server Version %v
hosts allow = 192.168.1.138,192.168.0.22,172.18.18.0/24
log file = /var/log/samba/log.%m
max log size = 50
passdb backend = tdbsam
cups options = raw
username map = /etc/samba/smbusers
security = share
#============================ Share Definitions ==============================
[TestRepo]
path = /TestRepo
browsable =yes
writable = yes
guest ok = yes
create mode = 0777
directory mode = 0777
-------------------------------------
---------------
/etc/init.d/smb start
/etc/init.d/nmb start
chkconfig smb on
chkconfig nmb on
selinux, iptable dissable
------------------------------------------------------
\\IP\test
Linux -> smbclient //IP/test -U testuser #yum install smb-client
or mount
vi /etc/fstab #mkdir /mnt/mymount # yum install cifs-utils samba-client samba -y
//IP/test /mnt/mymount cifs rw,user,username=testuser,password=testuser 0 0
mount -a
-------------------------
CENTOS 7
yum install samba samba-client samba-common -y
[global] workgroup = WORKGROUP server string = Samba Server %v
hosts allow = 172.16.16.0/24 192.168.0.126 192.168.0.35 max protocol = SMB2
security = user map to guest = bad user dns proxy = no #============================ Share Definitions ============================== [Anonymous] path = /samba/anonymous writable = yes browsable = yes guest ok = yes guest only = yes create mode = 0777 directory mode = 0777
-----------------------------
mkdir -p /samba/anonymous systemctl enable smb.service systemctl enable nmb.service systemctl restart smb.service systemctl restart nmb.servic
firewall-cmd --permanent --zone=public --add-service=samba firewall-cmd --reload
chmod -R 0755 anonymous/ chown -R nobody:nobody anonymous/
chcon -t samba_share_t anonymous/
thanks
ReplyDelete