【教程】Ubuntu安装SMB服务

首先说一下背景,自己女朋友在搜狗工作,刚好她们公司换电脑,200块买了一台,用作一个家庭服务器,装的是Ubuntu 18.04,自己也是在学习PY,后面有文件共享什么的比较麻烦,移动硬盘什么的插过去拔过来的很麻烦,于是打算安装SMB服务,作为文件共享。

首先更新系统

sudo apt-get upgrade 
sudo apt-get update 
sudo apt-get dist-upgrade

2020-02-06 00-21-40屏幕截图.png

安装smb

sudo apt-get install samba samba-common

SMB

给smb文件夹777权限,我开了两个文件夹,Huawei是用来备份手机数据和matepadpro数据的,

sudo chmod 777 /media/me/SMB/Huawei
sudo chmod 777 /media/me/SMB/SMB

设置me账号的密码(me更改为你的账号我登录smb的账号就是me)

sudo smbpasswd -a me

编辑smb.conf

sudo nano /etc/samba/smb.conf

如果没有安装nano,可以使用vi,个人觉得nano比较好用就用nano做演示

在最末端添加

[华为备份]
comment = share folder
browseable = yes
path = /media/me/SMB/Huawei
create mask = 0700
directory mask = 0700
valid users = me
force user = me
force group = me
public = yes
available = yes
writable = yes

[SMB]
comment = share folder
browseable = yes
path = /media/me/SMB/SMB
create mask = 0700
directory mask = 0700
valid users = me
force user = me
force group = me
public = yes
available = yes
writable = yes

bianji

可以讲上述中的me修改为你的账户,然后Ctrl+O保存Ctrl+X退出

最后一步重启smb

sudo service smbd restart

输入自己的主机地址,或者手机打开网络邻居输入smb账号密码即可连接

大工告成

smb , Ubuntu

共 3 条评论

  1. Briangob 

    (2020-06-13 20:33)

    回复
     

    where buy viagra buy viagra otc buy viagra in usa

  2. Briangob 

    (2020-06-9 7:16)

    回复
     

    buy generic viagra online overnight can i buy viagra direct from pfizer buy viagra next day delivery

  3. Justin 

    (2020-03-26 22:23)

    回复
     

    Long time supporter, and thought I'd drop a comment.

    Your wordpress site is very sleek - hope you don't
    mind me asking what theme you're using? (and don't
    mind if I steal it? :P)

    I just launched my site --also built in wordpress like yours-- but the theme slows (!) the site down quite
    a bit.

    In case you have a minute, you can find it by searching for "royal cbd" on Google (would appreciate any feedback) - it's
    still in the works.

    Keep up the good work-- and hope you all take care of yourself
    during the coronavirus scare!