docker run -it --name samba --net=host -v /home/samba:/mount -d dperson/samba -p \
-u "test;test123" \
-s "test;/mount;yes;no;no;all;all;all"
/home/samba指要共享的目录
-u "test;test123"用户名和密码
-s "test;/mount;yes;no;no;all;all;all"
解释如下
-s "<name;/path>[;browse;readonly;guest;users;admins;writelist;comment]"
Configure a share
required arg: "<name>;</path>"
<name> 客户端显示的名称
<path> path to share
NOTE: for the default values, just leave blank
[browsable] default:'yes' or 'no'
[readonly] default:'yes' or 'no'
[guest] allowed default:'yes' or 'no'
NOTE: for user lists below, usernames are separated by ','
[users] allowed default:'all' or list of allowed users
[admins] allowed default:'none' or list of admin users
[writelist] list of users that can write to a RO share
[comment] description of share
我习惯直接root
docker run -d --name samba --net=host \
-v /mnt/data:/data \
--restart=always \
dperson/samba \
-u "root;123456" \
-s "data;/data;yes;no;yes;all;all;all" -p
使用Docker搭建samba
未经允许不得转载:家里蹲的狐狸 » 使用Docker搭建samba