Samba

Samba

Samba

官网 https://www.samba.org/

centos下安装

1
yum -y install samba

配置

添加用户

1
smbpassword -a smb

配置文件 /etc/samba/smb.conf

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
[share]
comment = share file
path = /data/samba
public = yes
writable = no
available = yes
browseable = yes
valid users = smb
create mask = 0755
directory mask = 0755
guest ok = no
read only = yes

挂载

windows or cygwin

1
2
打开本地cmd
net use k: \\SMB_IP\share SMB_PASS /user:SMB_USER /PERSISTENT:YES

ansible

1
2
PowerShell -Command "net use k: \\\\SMB_IP\share SMB_PASS /user:SMB_USER"
cd /cygdrive/k

参考文档