配置samba共享,实现/www目录共享
环境准备:
IP | 操作系统及版本 | 描述 |
---|
10.0.0.7 | CentOS-7.9 | samba服务器 | 10.0.0.17 | CentOS-7.9 | samba客户端 |
1、在samba服务器上安装samba包
[root@samba-server ~]
2、创建samba用户和组
[root@samba-server ~]
[root@samba-server ~]
[root@samba-server ~]
New SMB password:
Retype new SMB password:
Added user wang.
[root@samba-server ~]
[root@samba-server ~]
New SMB password:
Retype new SMB password:
Added user zhang.
3、创建samba共享目录,并设置SElinux
[root@samba-server ~]
[root@samba-server ~]
[root@samba-server ~]
4、samba服务器配置
[root@samba-server ~]
[share]
path = /www
write list = @admins
[root@samba-server ~]
5、samba客户端配置
[root@samba-client ~]
6、用wang用户挂载smb共享并访问
[root@samba-client ~]
[root@samba-client ~]
Password for wang@//10.0.0.7/share: ******
[root@samba-client ~]
Filesystem Size Used Avail Use% Mounted on
devtmpfs 980M 0 980M 0% /dev
tmpfs 991M 0 991M 0% /dev/shm
tmpfs 991M 9.6M 981M 1% /run
tmpfs 991M 0 991M 0% /sys/fs/cgroup
/dev/sda2 99G 2.6G 91G 3% /
/dev/sda3 50G 33M 50G 1% /data
/dev/sda1 1014M 133M 882M 14% /boot
tmpfs 199M 0 199M 0% /run/user/0
//10.0.0.7/share 99G 7.7G 91G 8% /mnt/wang
[root@samba-client ~]
7、用zhang用户挂载smb共享并访问
[root@samba-client ~]
[root@samba-client ~]
Password for zhang@//10.0.0.7/share: ******
[root@samba-client ~]
Filesystem Size Used Avail Use% Mounted on
devtmpfs 980M 0 980M 0% /dev
tmpfs 991M 0 991M 0% /dev/shm
tmpfs 991M 9.6M 981M 1% /run
tmpfs 991M 0 991M 0% /sys/fs/cgroup
/dev/sda2 99G 2.6G 91G 3% /
/dev/sda3 50G 33M 50G 1% /data
/dev/sda1 1014M 133M 882M 14% /boot
tmpfs 199M 0 199M 0% /run/user/0
//10.0.0.7/share 99G 7.7G 91G 8% /mnt/wang
//10.0.0.7/share 99G 7.7G 91G 8% /mnt/zhang
[root@samba-client ~]
|