• docker samba


    这个就是匿名用户可以登录访问,不能写。

    root登录,就可以写了。

    #命令,是在物理机上运行的。

    主要是根据dockerfile构建镜像。

    启动容器

    进入镜像

    设置root密码。

    附smb.conf

    [global]
    netbios name = easypi
    workgroup = WORKGROUP
    server string = EasyPi Samba Server
    dns proxy = no
    log file = /var/log/samba/log.%m
    max log size = 1000
    syslog = 0
    panic action = /usr/share/samba/panic-action %d
    server role = standalone server
    passdb backend = tdbsam
    obey pam restrictions = yes
    unix password sync = yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Entersnews*spassword:* %n
     *Retypesnews*spassword:* %n
     *passwordsupdatedssuccessfully* .
    pam password change = yes
    map to guest = bad user
    usershare allow guests = yes
    printcap name = /dev/null
    load printers = no
    
    [homes]
    comment = Home Directories
    browseable = no
    writable = yes
    
    [share]
    comment = Public File Sharing
    path = /share
    browseable = yes
    read only = no
    guest ok = yes
    admin users = root
    root preexec = mkdir -p /share

    如果你想匿名就可以随意写的话,smb.conf如下,docker run 这行执行完,后面的就不用执行了。

    [global]
    netbios name = Samba
    workgroup = WORKGROUP
    server string = Samba Server
    map to guest = bad user
    browsenable = yes
    [share]
    path = /share
    public = yes 
    writable = yes
    create mask = 0765

    FROM alpine
    MAINTAINER kev <noreply@easypi.pro>

    RUN apk add --no-cache samba-common-tools samba-server
    COPY ./smb.conf /etc/samba/
    VOLUME /etc/samba
           /var/lib/samba
    EXPOSE 137/udp
           138/udp
           139/tcp
           445/tcp
    CMD nmbd -D && smbd -FS
    #docker build -t test .
    #docker run -d -t --restart=always --privileged --name samba -p 445:445 -p 139:139 -p 137:137/udp -p 138:138/udp -v /storage:/share test
    #docker exec -it samba sh -l
    #smbpasswd -a root  修改root登录samba用的密码,和登录密码不同

    /storage 是物理机目录。

    /share 是容器目录

    ftp配置完,不能用windows映射驱动器,实在没办法给小白用。

    还是给小白用sama吧。

  • 相关阅读:
    UML基本关系
    C++关键字简述
    Install opencv on Centos
    C++编程规范
    YCbCr to RGB and RGB toYCbCr
    Linux目录结构(二)
    Dubbo工作流程
    spring bean的作用域和生命周期
    spring aop原理和实现
    静态代理、jdk动态代理、cglib动态代理
  • 原文地址:https://www.cnblogs.com/jackadam/p/8512199.html
Copyright © 2020-2023  润新知