1. 程式人生 > >安裝samba服務器

安裝samba服務器

input inter -c group cat pos put dev cups

yum -y install samba-client samba-common cifs-utils samba
cat /dev/null > /etc/samba/smb.conf
vim /etc/samba/smb.conf

[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw

[logs]
comment = logs
path = /opt/logs/(指定共享路徑)
browseable = yes
read only = yes
guest ok = yes

  

iptables需要放行如下端口

-A INPUT -p tcp -m state --state NEW -m tcp --dport 139 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 445 -j ACCEPT
-A INPUT -p udp -m state --state NEW -m udp --dport 137 -j ACCEPT
-A INPUT -p udp -m state --state NEW -m udp --dport 138 -j ACCEPT

  

創建用戶,這裏創建系統用戶就行了,用useradd smbuser命令創建即可,但是重置密碼的時候需要用smbpasswd -a smbuser命令

systemctl restart smb

打開機器文件夾\\ip 輸入創建的賬號密碼即可

安裝samba服務器