samba 搭建
Posted tengfei520
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了samba 搭建相关的知识,希望对你有一定的参考价值。
#useradd -M -s /sbin/nologin kvmshare
#mkdir /home/etl
#chown kvmshare:kvmshare /home/etl
将本地账号添加到 samba 密码
xxx
#smbpasswd -a kvmshare
New SMB password:
Retype new SMB password:
Added user kvmshare.
修改配置如下 /etc/samba/smb.conf
[global]
server string = Samba Server Version %v
interfaces = lo br*
bind interfaces only = Yes
security = USER
log file = /var/log/samba/log.%m
max log size = 50
load printers = No
printcap name = /dev/null
idmap config * : backend = tdb
hosts allow = 127. 172.18.
printing = bsd
[kvm]
comment = KVM User read write
path = /home/etl
public = yes
writeable = yes
valid users = kvmshare
#service smb start
#systemctl enable smb.service 加入开机自启samba服务
#service smb status 开看samba服务是否启动
#ll /etc/systemd/system/multi-user.target.wants/ 查看samba服务是否正常加入自启
# pdbedit -L 查看samba用户
使用 smbclient 连接测试:
# smbclient //localhost/kvm -U kvmshare
Enter kvmshare‘s password:
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.2.10]
smb: \> ls
以上是关于samba 搭建的主要内容,如果未能解决你的问题,请参考以下文章