Samba 服务器

Server:192.168.1.211

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
yum -y install samba
vim /etc/samba/smb.conf
[linux]
comment = welcome to use samba
path = /home/linux
public = no
writable = yes
[windows]
comment = welcome to use samba
path = /windows
public = no
writabe =yes
groupadd windows
groupadd linux
useradd win_smb -g windows
useradd lin_smb -g linux
smbpasswd win_smb
smbpasswd lin_smb
pdbedit -L
mkdir /home/linux
mkdir /windows
chown win_smb:windows /windows
chown lin_smb:linux /home/linux
firewall-cmd --permanent --add-service=samba
firewall-cmd --reload
chcon -R -t samba_share_t /home/linux/ /windows/
getsebool -a | grep samba
setsebool -P samba_enable_home_dirs on
systemctl restart smb nmb

Desktop

Linux:192.168.1.210

1
2
3
4
5
6
7
8
9
10
11
12
13
14
yum  -y install samba-client cifs-utils
smbclient -L //192.168.1.211 -U lin_smb%samba1
smbclient //192.168.1.211 -U lin_smb%samba1
vim /etc/fstab
//192.168.1.211/linux /mnt/cifs cifs credentials=/root/usr,multiuser,sec=ntlmssp 0 0
mkdir /mnt/cifs
vim /root/usr
username=lin_smb
password=samba1
mount -a
useradd lin_smb
su - samba1
cifscreds add 192.168.1.211 -u lin_smb
cifscreds clearall

Windows:

1
2
3
4
Win+R 输入
\\192.168.1.211
用户名 win_smb
密码 samba2