使用CIFS通过LAN共享本地文件夹

我有一个文件夹(/ share,其中包含其他子文件夹和文件),我希望它通过我的LAN共享。 我在那里读到CIFS(取代Samba)是足以完成这项任务的文件系统。

那么,我做的是以下内容:

sudo mount -t cifs -o guest.rw //192.168.1.1/shared_folder /share 

(不要注意选项)

执行该命令后,将显示以下消息:

使用大写共享名称重试

mount error(6):没有这样的设备或地址

请参阅mount.cifs(8)手册页(例如man mount.cifs)

我已经阅读了手册页,但我不知道问题是什么……我做错了什么? 也许我没有指定正确的地址?

在那之后,我将设置我的fstab,但这不是问题。

谢谢你的奉献精神。

在服务器(共享)端 :右键单击要共享的文件夹(例如Documents),然后单击属性:

在此处输入图像描述

启用共享选项(nautilus将为您下载并安装samba)。 您可能还需要检查访客的访问权限。

在客户端:

 sudo apt-get install cifs-utils 

并挂载它(作为访客):

 sudo mount -t cifs -o guest //sharing_machine_ip/Documents /mountpoint 

您还可以添加一些其他选项,如用户和密码:

 sudo mount -t cifs -o username=your_username,password=your_password //sharing_machine_ip/Documents /mountpoint 

如果您希望在启动时自动挂载(作为guest – 表示您不需要密码来访问共享),则可以添加到/ etc / fstab的末尾:

 //sharing_machine_ip/Documents /your_mountpoint cifs guest 0 0 

或使用密码保护的共享:

 //sharing_machine_ip/Documents /your_mountpoint cifs username=your_username,password=your_password 0 0