Linux mount smb共享文件夹

Linux mount smb共享文件夹

安装cifs-utils工具

apt install cifs-utils
mkdir /mnt/nfs

使用smbclient工具查询共享目录

smbclient -L 192.168.31.254

root@router:/mnt# smbclient -L 192.168.31.254
Enter WORKGROUP\liang's password: 

        Sharename       Type      Comment
        ---------       ----      -------
        thinkpad        Disk
        IPC$            IPC       IPC Service (Share from router)

Reconnecting with SMB1 for workgroup listing.
        Server               Comment
        ---------            -------
        Workgroup            Master
        ---------            -------
        WORKGROUP            LIANG-MIWIFI

匿名挂载

mount.cifs //192.168.31.254/thinkpad /mnt/nfs

guest挂载

mount -t cifs //192.168.31.254/thinkpad /mnt/nfs/ -o guest

指定用户挂载

mount -t cifs -o username=administrator,password=123 //192.168.31.254/thinkpad /mnt/nfs