Samba服务器搭建
折腾自己的nas搭建samba服务
安装并且编辑配置文件
sudo apt-get install samba sudo apt-get install samba-client sudo vim /etc/samba/smb.conf
增加账户(其实直接smbpasswd 应该就可以了 这里已经加了,回头下次有机会如果重新安装可以注意下)
share:x:1001:6000::/dev/null:/usr/sbin/nologin
sudo smbpasswd -a share
[share] comment = Share Folder require password browseable = yes path = /data/media create mask = 0777 directory mask = 0777 valid users = share force user = nobody force group = nogroup public = yes writable = no available = yes
这里smbpasswd 这个账号 -a 命令
smbpasswd: invalid option -- '-' When run by root: smbpasswd [options] [username] otherwise: smbpasswd [options] options: -L local mode (must be first option) -h print this usage message -s use stdin for password prompt -c smb.conf file Use the given path to the smb.conf file -D LEVEL debug level -r MACHINE remote machine -U USER remote username (e.g. SAM/user) extra options when run by root or in local mode: -a add user -d disable user -e enable user -i interdomain trust account -m machine trust account -n set no password -W use stdin ldap admin password -w PASSWORD ldap admin password -x delete user -R ORDER name resolve order
重启的脚本应该更新了
sudo /etc/init.d/smbd restart
CENTOS 安装
yum install samba samba-client group add samba groupadd samba useradd -g samba -d /data/samba/ cat /etc/passwd useradd -g samba -d /data/samba/ -s /sbin/nologin samba
samba需要本地用户
查看samba信息
[root@pooky_lus1804 ~]# rpm -qi samba Name : samba Epoch : 0 Version : 4.8.3 Release : 4.el7 Architecture: x86_64 Install Date: 2019年04月22日 星期一 23时04分17秒 Group : Unspecified Size : 2037669 License : GPLv3+ and LGPLv3+ Signature : RSA/SHA256, 2018年11月12日 星期一 22时46分06秒, Key ID 24c6a8a7f4a80eb5 Source RPM : samba-4.8.3-4.el7.src.rpm Build Date : 2018年10月31日 星期三 06时33分48秒 Build Host : x86-01.bsys.centos.org Relocations : (not relocatable) Packager : CentOS BuildSystem <http://bugs.centos.org> Vendor : CentOS URL : http://www.samba.org/ Summary : Server and Client software to interoperate with Windows machines Description : Samba is the standard Windows interoperability suite of programs for Linux and Unix.
网上有很多 ,这就不一个一个搞了
https://blog.csdn.net/qq_33789722/article/details/80269529