2009/06/30

Linux下用smbmount命令挂载Windows共享

在Windows操作系统之间,可以通过映射网络驱动器的方式,将某个共享目录映射成一个磁盘文件系统,在Linux下,可以通过smbmount命令来实现相似的功能,将Windows的某个共享目录挂载到Linux下的某个目录下。

Note: ubuntu GUI下的"connect to server"并未真正mount windows shared filesystem, so can not see any mounted directory in terminal.

Let's manually mount a windows share thru commands!


1. Install smbmount

sudo apt-get install smbfs


2. Create a mount point "~/Desktop/winxp" in Ubuntu

fanghui@vbox:~/Desktop$ mkdir winxp # 必须先创建目录 winxp


3. smbmount command.

语法:smbmount //IP地址/共享名 挂载点 -o username=xxx,password=yyy
For example:
挂载整个c$共享
$ sudo smbmount //155.69.148.204/c$ ~/Desktop/winxp -o username=xxx
Password:

挂载某个目录"fanghui"
$ sudo smbmount //155.69.148.204/fanghui ~/Desktop/winxp -o username=xxx,password=xxxxxx


现在用mount查看,会看到最末一行:
//155.69.148.204/fanghui on /home/fanghui/Desktop/winxp type cifs (rw,mand)

4. umount
$ sudo umount ~/Desktop/winxp


Refer to:
Accessing an SMB Share With Linux Machines

没有评论: