【记录】Setup Samba server on ubuntu 16.04

发表于2017-05-22    类别: 技术(65)    标签: 记录(25) Ubuntu(11)

记录一下过程中使用的命令。

$ sudo apt-get install samba
$ sudo vi /etc/samba/smb.conf

加上如下配置

#======================= Share Definitions =======================
[czshare]
    comment = All
    browseable = yes
    path = /home/pc
    read only = no
    valid users = @pc
    create mask = 0777
    directory mask = 0777

然后增加pc这个user

$ sudo smbpasswd -a pc
New SMB password:
Retype new SMB password:
Failed to add entry for user pc.

出错是因为要先在系统里面增加这个user

$ sudo groupadd pc -g 6000
$ sudo useradd pc -u 6000 -g 6000 -s /sbin/nologin -d /dev/null
$ sudo smbpasswd -a pc
$ cd /home
$ sudo mkdir pc
$ sudo chown -R pc:pc /home/pc
$ sudo systemctl restart smbd.service nmbd.service

完成~

相关文章

   2023-12-31 【记录】浮点数存储方式
   2021-01-05 【转载】使用iotop监控磁盘I/O
   2017-06-26 【记录】调整ext4分区大小
   2017-06-10 【转载】如何启用Ubuntu的休眠模式
   2017-06-09 【记录】Ubuntu 16.04安装Android Studio
   2017-06-04 【记录】Ubuntu 16.04 Config and Installing
   2017-06-04 【记录】Ubuntu 16.04安装中文输入法
   2017-05-29 【收藏】一些命令收集(持续更新)
   2017-05-22 【收藏】自己修改编译ubuntu终端
   2017-05-19 【收藏】Ubuntu16.04下设置终端的标题