目录

Ubuntu安装samba

目录

一、安装 samba

1
2
sudo apt update
sudo apt install samba

二、挂载硬盘

硬盘将要挂载的目录 mkdir /home/<username>/sambashare/

确定挂载的硬盘:

/ubuntu%E5%AE%89%E8%A3%85samba/Pasted%20image%2020231105173854.png

把硬盘挂载到刚刚创建的目录

1
sudo mount /dev/sdb1 home/<username>/sambashare/

检查是否挂载成功 lsblk

/ubuntu%E5%AE%89%E8%A3%85samba/Pasted%20image%2020231105031132.png

三、编写配置文件并创建用户

编辑 sudo vim /etc/samba/smb.conf

1
2
3
4
5
[sambashare]
    comment = Samba on Ubuntu
    path = /home/username/sambashare
    read only = no
    browsable = yes

创建smb用户

Note:

Username used must belong to a system account, else it won’t save

1
sudo smbpasswd -a username

四、启动服务

1
sudo service smbd restart

参考

Install and Configure Samba | Ubuntu

linux局域网共享文件夹和个人家庭影院搭建 - 知乎 (zhihu.com)

相关内容

Ubuntu-Server2204LTS系统迁移
小米路由器samba让WAN口设备访问
UbuntuServer22LTS设置静态IP