
samba挂载不能删文件夹
If you want to “map a drive” from a Linux computer to a shared folder on a Windows computer or a shared folder on a Linux computer running Samba, there’s a simple way that you can do this from the command line.
如果要将Linux计算机上的驱动器映射到Windows计算机上的共享文件夹或运行SambaLinux计算机上的共享文件夹,则有一种简单的方法可以从命令行进行。
Contents
|
内容
|
安装先决条件(Installing Prerequisites)
If you are running on Ubuntu or another Debian distribution, you can install the required software by simply running the following command from a terminal prompt:
如果您在Ubuntu或其他Debian发行版上运行,则可以从终端提示符处简单运行以下命令来安装所需的软件:
sudo apt-get smbclient smbfs
测试连接 (Testing the Connection)
Now that you have the right tools installed, it’s time to test the connection to the Windows or Samba box with the shared folder. For this we can use the smbclient command like so:
现在您已经安装了正确的工具,是时候使用共享文件夹测试到Windows或Samba框的连接了。 为此,我们可以使用smbclient命令,如下所示:
smbclient –L geekmini –U geek
In this example, geekmini is the servername and geek is the username. You’ll be prompted for the password. You’ll notice that you can successfully see a list of shares on the remote computer. In our case, we want to “map a drive” to the shared folder named “root”.
在此示例中,geekmini是服务器名,geek是用户名。 系统将提示您输入密码。 您会注意到,您可以在远程计算机上成功看到共享列表。 在我们的例子中,我们想“将驱动器”映射到名为“ root”的共享文件夹。
创建挂载点 (Create the Mount Point)
Any time you want to map a drive in Linux, you should create the folder first. In this case, I want to access that shared folder from /media/Video, so I’ll first need to create the folder.
任何时候要在Linux中映射驱动器,都应首先创建文件夹。 在这种情况下,我想从/ media / Video访问该共享文件夹,因此首先需要创建该文件夹。
sudo mkdir /media/Video
Note that I’m using sudo because I’m creating the folder in a system-wide location owned by root.
请注意,我正在使用sudo,因为我是在root拥有的系统范围位置创建文件夹。
实际挂载共享文件夹 (Actually Mounting the Shared Folder)
You can run the following command to mount the shared folder to a local path:
您可以运行以下命令将共享文件夹安装到本地路径:
mount –t cifs –o username=geek,password=thepass //geekmini/root /media/Video
Note that you’d want to use your own details in the command. At this point you should be able to access the shared folder from /media/Video
请注意,您想在命令中使用自己的详细信息。 此时,您应该可以从/ media / Video访问共享文件夹
samba挂载不能删文件夹