系统版本 ubuntu 22.04
sudo apt install cifs-utils
sudo apt install smbclieat
smbclient -L //192.168.1.7 -U [username]%[password]
通过 cifs-utils 挂载
ps 本地目录需要提前创建
sudo mount.cifs "//192.168.1.5/[sharePath]" ~/[sharePath] -o username=[username],password=[password]
sudo umount ~/[sharePath]
通过 fstab 文件自动挂载 ps 本地目录需要提前创建
sudo vim /etc/fstab
添加一行, 保存退出
// 添加如下代码
// [sharePath] 为共享目录名称
// [username] 为共享目录用户名
// [password] 为共享目录密码
// [sharePath] 为共享目录名称
// ~/[sharePath] 为本地目录
// username=[username],password=[password] 为共享目录用户名和密码