linux shared files - samba server

Smb server client installed;

# yum install samba samba-client -y

sambe profile configuration

/ etc / Samba / the smb.conf
 
[ Global ] 
# global configuration 
Workgroup = MYGROUP 
Server String = the Samba Server Version% V 

; the interfaces = eth0 LO 192.168 . 12.2 / 24  192.168 . 13.2 / 24  
the hosts the allow = 172.16.2.23 
# restriction link IP 

Printers the Load = yes 
the CUPS Options = RAW 

[the Test - Work] 
# shared directory settings 
commont
= Test- Work path = / Home /user1 available = yes valid users = test browseable = yes writable = yes public = yes

 Set samba access account user1;

useradd user1 &&echo '123456'| passwd --stdin user1
smbpasswd - A user1 
smbpasswd -e user1 

# smbpasswd: The way is to use smb own tools smbpasswd to set up a resource Samba password, the client will use this password to access Samba to system users (real users or virtual users).

Adding a firewall rule tcp 139,445 udp 137,138

Add # iptables rules
iptables -A -m Multiport --dports the INPUT -p UDP 137 , 138 - J ACCEPT iptables -I -p the INPUT NEW Multiport --state State TCP -m -m --dport 139 , 445 - J ACCEPT
# preservation services iptables restart
/etc/init.d/ iptables the save /etc/init.d/iptables restart

View rules:
iptables -L---line Number The -n

Client Access test: \\ 172.16.2.23

 

Guess you like

Origin www.cnblogs.com/sharesdk/p/11079167.html