环境:ubuntu server 24.04
步骤如下:
sudo apt update
sudo apt install samba
修改配置文件:
sudo vi /etc/samba/smb.conf
新增内容:
[username]
path = /home/[username]
available = yes
valid users = [username]
read only = no
browsable = yes
public = yes
writable = yes
将 username 换成自己的账户名即可
设置密码:
sudo smbpasswd -a [username]
重启 samba
sudo systemctl restart smbd
然后在 windows 新增一个网络位置: