用Samba匿名用户搭建共享服务器
程序员文章站
2024-03-13 22:47:46
...
主机名 | IP |
---|---|
服务器 | 192.168.100.100 |
客户端 | 192.168.100.129 |
先完成Samba的安装
先准备搭建的环境和配置
安装软件停掉防火墙
[root@localhost ~]#systemctl stop firewalld
[root@localhost ~]#setenforce 0
[root@localhost ~]#yum install samba-*
安装samba
[root@localhost ~]# yum -y install samba-* //服务端
[root@localhost ~]# yum -y install samba-* //客户端
启动服务,并加入到开机自启
[root@localhost ~]# systemctl start smb
启动服务,并加入到开机自启
[root@localhost ~]# systemctl start smb
[root@localhost ~]# systemctl enable smb
搭建匿名用户共享服务器,服务端配置,新建共享目录,设置权限
[root@localhost ~]# mkdir /date/samba/shard -p
[root@localhost ~]# chmod 777 /date/samba/shard/ -R
修改/etc/samba/smb.conf的配置文件
[root@localhost ~]# cat /etc/samba/smb.conf
See smb.conf.example for a more detailed config file or
read the smb.conf manpage.
Run 'testparm' to verify the config is correct after
you modified it.
[global]
workgroup = SAMBA
security = user
map to guest = Bad User //匿名用户 虚拟的
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[samba-shard]
comment = This is shard //说明信息
path = /date/samba/shard //共享文件的路径
browseable = yes //共享文件可见
guest ok =yes //所有人均可访问共享
writable = yes //读写权限
public = yes //开启匿名访问
检测配置文件是否修改有误
[[email protected] ~]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[samba-shard]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
重启服务
[[email protected] ~]# systemctl restart smb
客户端检测
查看共享目录
[[email protected] ~]# smbclient -L 192.168.100.33 -U 'Bad user' //不用输入密码,直接回车
挂载
[root@localhost ~]#mkdir /cifs //建立挂载点
[root@localhost ~]#mount -t cifs //192.168.100.33/samba-shard /cifs/ -o user="Bad User" //不用输入密码 直接回车
验证检测
[root@localhost ~]#mkdir qinyong //客户端有写入权限
[root@localhost ~]# ls /date/samba/shard/
qinyong systemctl enable smb
搭建匿名用户共享服务器,服务端配置,新建共享目录,设置权限
[root@localhost ~]# mkdir /date/samba/shard -p
[root@localhost ~]# chmod 777 /date/samba/shard/ -R
修改/etc/samba/smb.conf的配置文件
[root@localhost ~]# cat /etc/samba/smb.conf
See smb.conf.example for a more detailed config file or
read the smb.conf manpage.
Run 'testparm' to verify the config is correct after
you modified it.
[global]
workgroup = SAMBA
security = user
map to guest = Bad User //匿名用户 虚拟的
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[samba-shard]
comment = This is shard //说明信息
path = /date/samba/shard //共享文件的路径
browseable = yes //共享文件可见
guest ok =yes //所有人均可访问共享
writable = yes //读写权限
public = yes //开启匿名访问
检测配置文件是否修改有误
[[email protected] ~]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[samba-shard]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
重启服务
[root@localhost ~]# systemctl restart smb
客户端检测,查看共享目录
[[email protected] ~]# smbclient -L 192.168.100.100 -U 'Bad user' //不用输入密码,直接回车
挂载
[[email protected] ~]#mkdir /cifs //建立挂载点
[[email protected] ~]#mount -t cifs //192.168.100.33/samba-shard /cifs/ -o user="Bad User" //不用输入密码 直接回车
检测
[root@localhost ~]#mkdir qinyong //客户端有写入权限
[root@localhost ~]# ls /date/samba/shard/
qinyong yum -y install samba-client //客户端
上一篇: Linux中FTP安装与配置
下一篇: Oracle expdp 过滤和并行
推荐阅读
-
用Samba匿名用户搭建共享服务器
-
运维之道 | Samba 文件共享传输服务(匿名用户访问、指定用户访问、共享账号映射访问)
-
Linux系统怎么搭建Samba共享服务器?
-
centos7搭建ftp服务器并配置匿名用户
-
samba + OPENldap 搭建文件共享服务器
-
使用Samba在Linux服务器上搭建共享文件服务的方法
-
2020-10-20 Ubuntu 16.04安装配置Samba服务每个用户可以用自己的用户名和密码登录自己的home目录以及共享特定的目录
-
公网Linux服务器开启samba(smb)文件共享服务给家里电脑用
-
centos7搭建ftp服务器并配置匿名用户
-
Linux系统怎么搭建Samba共享服务器?