家庭NAS搭建实战之samba共享
生活随笔
收集整理的這篇文章主要介紹了
家庭NAS搭建实战之samba共享
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
家庭NAS搭建實戰(zhàn)之samba共享
- 一、系統(tǒng)環(huán)境
- 二、配置倉庫源
- 1.備份原有倉庫源
- 2.配置新debain源
- 3.更新debain源
- 二、安裝samba軟件
- 1.安裝軟件
- 2.設置共享目錄
- 3.設置共享目錄權限
- 4.新建samba用戶
- 5.查看smba用戶列表
- 三、修改samba配置文件
- 四、測試配置文件
- 五、設置開機自啟服務
- 六、測試登錄
一、系統(tǒng)環(huán)境
root@onecloud:~# cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 9 (stretch)" NAME="Debian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" VERSION_CODENAME=stretch ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" root@onecloud:~#二、配置倉庫源
1.備份原有倉庫源
cp /etc/apt/sources.list /etc/apt/sources.listbak #備份原有配置文件2.配置新debain源
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib deb http://mirrors.aliyun.com/debian-security stretch/updates main deb-src http://mirrors.aliyun.com/debian-security stretch/updates main deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib #deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib #deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib3.更新debain源
apt-get update二、安裝samba軟件
1.安裝軟件
root@onecloud:/var/lib/dpkg# apt-get install -y samba2.設置共享目錄
mkdir -p /data/NAS/nas3.設置共享目錄權限
root@onecloud:~# chmod 777 /data/NAS/nas/ root@onecloud:~# ls -ld /data/NAS/nas/ drwxrwxrwx 3 root root 4096 Jan 24 22:53 /data/NAS/nas/4.新建samba用戶
root@onecloud:~# groupadd it root@onecloud:~# useradd -g it admin root@onecloud:~# sabpasswd -a adminroot@onecloud:~# smbpasswd -a admin New SMB password: root@onecloud:~# smbpasswd -a admin New SMB password: Retype new SMB password: Added user admin.5.查看smba用戶列表
root@onecloud:~# pdbedit -L admin:1003: root@onecloud:~#三、修改samba配置文件
root@onecloud:~# vim /etc/samba/smb.conf [share]path = /data/NAS/nas/browseable = yeswrite list = @ithosts allow = 192.168.3.0/24四、測試配置文件
root@onecloud:~# testparm /etc/samba/smb.conf Load smb config files from /etc/samba/smb.conf rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) Processing section "[share]" Loaded services file OK. Server role: ROLE_STANDALONEPress enter to see a dump of your service definitions# Global parameters [global]idmap config * : backend = tdb[share]path = /data/NAS/nas/hosts allow = 192.168.3.0/24write list = @it root@onecloud:~#五、設置開機自啟服務
root@onecloud:~# systemctl start smbd root@onecloud:~# systemctl enable smbd Synchronizing state of smbd.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable smbd root@onecloud:~#六、測試登錄
windows電腦登錄
總結
以上是生活随笔為你收集整理的家庭NAS搭建实战之samba共享的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Mongodb的安装部署
- 下一篇: Docker容器之macvlan网络