Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit 1da70a3

Browse files
committed
samba
1 parent fca8a09 commit 1da70a3

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
NO.|文件名称|摘要
1010
:--:|:--|:--
11+
0006| [搭建samba服务端](docs/0006_搭建samba服务端.md) | 像访问普通文件夹一样访问树莓派文件系统
1112
0005| [内核编译](docs/0005_内核编译.md) | 编译Linux内核,以备后续修改及分析驱动
1213
0004| [Debug串口](docs/0004_Debug串口.md) | 看内核启动log信息,当机器无法启动可以判定问题
1314
0003| [开源软件镜像站加速](docs/0003_开源软件镜像站加速.md) | 时间很宝贵,只介绍apt、pip镜像站,其他可自行扩展

docs/0006_搭建samba服务端.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# 搭建samba服务端
2+
3+
像访问普通文件夹一样访问树莓派文件系统
4+
5+
6+
## steps
7+
8+
* `sudo apt-get install samba samba-common-bin`
9+
* `sudo smbpasswd -a pi`:输入pi用户的samba访问密码
10+
* `sudo vim /etc/samba/smb.conf`
11+
```
12+
[...省略]
13+
[homes]
14+
comment = Home Directories
15+
browseable = no
16+
17+
# By default, the home directories are exported read-only. Change the
18+
# next parameter to 'no' if you want to be able to write to them.
19+
read only = no # <-- 如果需要可读可写,改为no
20+
21+
# File creation mask is set to 0700 for security reasons. If you want to
22+
# create files with group=rw permissions, set next parameter to 0775.
23+
create mask = 0700
24+
[...省略]
25+
```
26+
* `sudo systemctl restart smbd.service nmbd.service`
27+
```
28+
root@raspberrypi:/etc/samba# ps aux | grep smb
29+
root 526 0.0 3.1 40716 13948 ? Ss 10:58 0:00 /usr/sbin/smbd
30+
root 530 0.0 1.2 38700 5524 ? S 10:58 0:00 /usr/sbin/smbd
31+
root 531 0.0 1.1 38712 4980 ? S 10:58 0:00 /usr/sbin/smbd
32+
root 544 0.0 1.2 40704 5464 ? S 10:58 0:00 /usr/sbin/smbd
33+
root 730 0.1 3.1 41124 14016 ? S 10:59 0:00 /usr/sbin/smbd
34+
root 818 0.0 0.4 4364 1964 pts/0 S+ 11:07 0:00 grep smb
35+
```
36+
* [windows下网上邻居] -> [右键] -> [映射网络驱动器],输入文件夹框`\\<your ip address>\pi`,按提示输入用户名密码即可。

0 commit comments

Comments
 (0)