Ubuntu挂载smb到本地

常规

sudo apt-get install cifs-utils -y

sudo mkdir /airdisk;vim /etc/fstab

/etc/fstab添加
//192.168.123.22/新加卷-a/airdisk cifs username=airdisk,password=1234qwer,iocharset=utf8,sec=ntlm 0 0

sudo mount -a

临时使用: mount -t cifs -o username=eric,password=123qwe //10.1.20.218/share_test /mnt/share_test -o vers=2.1

Docker

docker run -d --name smb-mount \
    --restart=unless-stopped \
    --cap-add SYS_ADMIN \
    --cap-add DAC_READ_SEARCH \
    --security-opt apparmor:unconfined \
    -e SERVERPATH="//10.1.20.155/share" \
    -e MOUNTOPTIONS="vers=2.1,uid=1000,gid=1000,rw,username=XXXXXX,password=XXXXXXX" \
    -v /mnt/HostMountPoint:/mnt/smb:shared \
    mumiehub/smb-mount
posted @ 2020-12-26 13:59  秒年度  阅读(2668)  评论(0编辑  收藏  举报