惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
GbyAI
GbyAI
S
SegmentFault 最新的问题
量子位
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
V
Visual Studio Blog
U
Unit 42
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
J
Java Code Geeks
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
IT之家
IT之家
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
雷峰网
雷峰网

博客园 - 爱吃糖豆的猪

【自学Python系列】Python 基础 内部数据结构之列表和元组 【自学Python系列】Python 基础 (字符串,整数,注释) 控制台I/O显示格式化的结果 异步拷贝文件 【超详细教程】使用Windows Live Writer 2012和Office Word 2013 发布文章到博客园全面总结 如何在Directory.GetFiles()方法中设置多个格式呢? C#操作符??和?: ETL 解析 简单通用的访问CVS的方法 一些概念的随笔(转) 3种思维培养有决策力的孩子 是夫妻就一起把它戒了吧! 一个10年SEO工作者的35个SEO经验 可以让你少奋斗10年的工作经验 如何在一年内拥有十年的工作经验(值得你反复读5遍以上) TreeView 递归选择父节点和子节点 文件操作 C# 中的 ConfigurationManager类引用方法 添加Word,Excel等dll时如何操作。
Manjaro Samba 设置共享文件夹供Windows访问
爱吃糖豆的猪 · 2021-12-28 · via 博客园 - 爱吃糖豆的猪

最近有些资料需要传入到我的老兵(旧笔记本Manjaro)中,使用SamClient并且记录一下

Install:
pacman -S cifs-utils smbclient samba manjaro-settings-samba

set sharefolder:
mkdir /home/share

set permission:
chmod 777 /home/share

create a user for share:
sudo useradd [user]
sudo userdel – r user1 # delete user

edit the config file:
/etc/samba/smb.conf

append setting:

[m_share]
  comment = MSShare Directories
  path = /home/share
  writable = yes
  available = yes
  browseable = yes
  read only = no # read only 属性设置为no 是为了有写入文件权限
  create mask = 0700
  directory mask = 0700

check settings:
testparm

start server:
systemctl enable smb nmb
systemctl start smb nmb

check status:
systemctl status smb

set use and pwd:
gpasswd sambashare -a [user]
smbpasswd -a [user]

[摘录]备份并编辑smb.conf允许网络用户访问

Sudo cp /etc/samba/smb.conf /etc/samba/smb.conf

Sudo gedit /etc/samba/smb.conf

搜索security=user

加入

security = user

username map = /etc/samba/sambausers

文件最后加入:允许访问用户为 user1 贡献目录/home/xxxxx/share

windows 可以直接访问共享文件夹进行CRUD操作,这里有一些坑:

  1. 对于setting配置中 需要设置 security=user

  2. 每次使用需要 start server

  3. 对文件夹设置访问权限,不然不能写入

然后从windows访问samba共享目录,无论使用自己创建的samba用户还是root用户都提示用户名密码错误使用:smbpasswd命令:

smbpasswd -a samba

passwd samba,然后从新登陆成功。

smbpasswd -a 增加用户(要增加的用户必须以是系统用户)

smbpasswd -d 冻结用户,就是这个用户不能在登录了

smbpasswd -e 恢复用户,解冻用户,让冻结的用户可以在使用

smbpasswd -n 把用户的密码设置成空.

使用samba命令输出日志信息: smbd -F -S
目录权限问题应该设置成755: chmod -R 0755 xxxx 有问题 修改为0700

参考自Using Samba in your File Manager( https://wiki.manjaro.org/index.php?title=Using_Samba_in_your_File_Manager#KDE