Linux 设置windows可见的文件夹共享,创建只拥有读权限的共享用户,samba工具安装,“smbpasswd: command not found“问题解决

简介: Linux 设置windows可见的文件夹共享,创建只拥有读权限的共享用户,samba工具安装,“smbpasswd: command not found“问题解决

linux 设置 windows 可见的共享文件夹

第一章:文件夹共享设置方法

① 设置文件共享,只拥有读权限

首先通过 useradd username 添加一个用户。

image.png

然后通过 smbpasswd -a username 来修改下密码。

如果提示 smbpasswd: command not found 请看第③节。

smbpasswd -e username 来启用该用户。

然后 vi /etc/samba/smb.conf 来修改配置文件。

image.png

修改示例:

[ncc_home]
        comment = view the ncc home
        browseable = yes
        path = /data/ncc_home/
        read only = yes
        guest ok = no
        write list = @root

参数说明:

[smb_name] 共享后的文件夹名字

comment 描述下该共享路径的用途

browseable 是否允许浏览

path 要共享的服务器物理路径

read only 是否只读

guest ok 是否允许匿名访问

write list 允许写的用户,可以填写整个用户组:@用户组名

image.png

配置完配置文件后,重启 samba 服务才能生效。

service smb restart

注: 有的服务名是 smbd,如果 smb 不行,可以试一下。

image.png

② windows 用户访问测试

win+R 打开运行。

image.png

image.png

可以看到我共享的文件夹名了。

image.png

找个文件删除一下,提示文件访问被拒绝。

image.png

③ samba 服务安装,"smbpasswd: command not found"问题解决

说明没有安装 samba 工具。

image.png

通过 yum install samba-clientyum install samba 命令来安装就行了。

通过rpm -qa | grep samba查看状态

image.png

喜欢的点个赞❤吧!

目录
相关文章
|
7月前
|
安全 Linux 生物认证
Nexpose 8.25.0 for Linux & Windows - 漏洞扫描
Nexpose 8.25.0 for Linux & Windows - 漏洞扫描
325 0
Nexpose 8.25.0 for Linux & Windows - 漏洞扫描
|
7月前
|
安全 Linux iOS开发
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
704 53
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
|
7月前
|
安全 Linux 生物认证
Nexpose 8.24.0 for Linux & Windows - 漏洞扫描
Nexpose 8.24.0 for Linux & Windows - 漏洞扫描
384 17
Nexpose 8.24.0 for Linux & Windows - 漏洞扫描
|
7月前
|
SQL 安全 Linux
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
401 1
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
|
7月前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
828 1
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
|
7月前
|
Linux 虚拟化 iOS开发
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
1756 0
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
|
7月前
|
Linux iOS开发 计算机视觉
GIMP 3.0.6 (Linux, macOS, Windows) 发布 - 免费开源图像编辑器
GIMP 3.0.6 (Linux, macOS, Windows) 发布 - 免费开源图像编辑器
572 0
|
Windows 数据安全/隐私保护 存储
|
7月前
|
安全 数据安全/隐私保护 虚拟化
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
1936 2
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
|
7月前
|
安全 Unix 物联网
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 10 月更新)
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 10 月更新)
834 0
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 10 月更新)