One: the instructions used
1:检查是否安装samba了服务
rpm -qa |grep samba
2:安装samba服务
mkdir /iso 建立子目录
mount /dev/cdrom /iso 挂载光盘
vim /etc/yum.repos.d/dvd.repo 配置yum源
[dvd]
name=dvd
baseurl=file:///iso
gpgcheck=0
enabled=1
yum info samba 査看Samba安装文件
yum clean all 清除缓存
yum install samba-client -y 安装客户端
yum install cifs-utils -y
//设置状态
setenforce 0
//匿名方式进行访问
smbclient -L 192.168.1.99
//访问的具体路径
smbclient //192.168.1.99/public
ls 进行查看
Two: detailed steps
1: enable the client to ping the server
①: Set customer terminal and the server IP
click shut symbols> Click finite set
click set the symbol set, set the parameters as follows
Samba server
after restart the provided click Open
Samba client
set up after clicking the button restart the punch
②: Set customer end and server network adapters
Note: customer end and server should be set]
VM> click Settings
Network Adapter> Select VMnet1 (Host mode only)
③: Ping the server in the customer service side
[Note: Press Ctrl + z to stop]
ping 192.168.1.99
2: The client and server Samba let the firewall pass
[Note: Both the client and server must be closed]
①: Use the graphical interface to close
Enter the administrator password
②: Use the command mode
firewall-cmd --permanent --add-service=samba
refresh
firewall-cmd --reload
3: Install Samba service on the server
Installation tutorial, click to jump
4: Install Samba service on the client side
The previous steps are basically the same as the server. The instructions are as follows
1:检查是否安装samba了服务
rpm -qa |grep samba
2:安装samba服务
mkdir /iso 建立子目录
mount /dev/cdrom /iso 挂载光盘
vim /etc/yum.repos.d/dvd.repo 配置yum源
[dvd]
name=dvd
baseurl=file:///iso
gpgcheck=0
enabled=1
yum info samba 査看Samba安装文件
yum clean all 清除缓存
Note that this is different, install the customer service!
//安装客服端
yum install samba-client -y
yum install cifs-utils -y
5: Create a shared file on the server
Linux commands used
//创建共享文件夹
mkdir /share
cd /share
//创建文件
echo my name is xxx >file.txt
//查看文件
cat file.txt
6: The server sets the attributes of the shared file
①: Enter into smb.conf
vim /etc/samba/smb.conf
②: Add the attribute map to guest = bad user.
In the passdb backend… press Tab to jump to the header part of the corresponding column
[Note: Insert mode: insert]
//无需输入密码
map to guest=bad user
③: Add [public] shared file attribute
//只读属性共享
[public]
comment=public
path=/share
browseable=yes
read=yes
public=yes
④: Save and exit Save and exit
in bottom line mode
【Note: Press Esc to enter bottom line mode】
:wq!
⑤: Restart the samba service
//重启samba服务
systemctl restart smb
⑥: set enforce to 0
//设置一下
setenforce 0
//查看状态
getenforce
Before setting
set
after set
7: Server access
①: Anonymous access (Anonymous mode does not need to enter a password, just press Enter)
[Note: But has not yet entered the server for access]
//192.168.1.99 这个是服务端ip
smbclient -L 192.168.1.99
②: Access shared resources on the server side (no need to enter a password in the anonymous mode, just press Enter)
[Note: enter the server side at this time]
smbclient //192.168.1.99/public
Now that we have come in, enter the ls command to view (at this time we can see the shared file file.txt we created)
ls