Chinaunix首页 | 论坛 | 博客
  • 博客访问: 662053
  • 博文数量: 291
  • 博客积分: 10025
  • 博客等级: 上将
  • 技术积分: 2400
  • 用 户 组: 普通用户
  • 注册时间: 2004-12-04 12:04
文章分类

全部博文(291)

文章存档

2008年(102)

2007年(112)

2006年(75)

2004年(2)

我的朋友

分类:

2006-10-23 09:42:42

VI3中已经内置了smbclient. 但使用前你必须在configuration|security profile中放开smb client.

你可以用两种方式来使用samba, 一种我称之为ad hoc方式,一种为fstab方式。两者的区别在于对于ad hoc方式,所有的选项都在CLI中,而对于后者,则都在/etc/fstab文件中。

使用samba的步骤为:

1)     在一台Windows服务器上找一个目录,设置共享,并允许读写

2)     service console中使用ad hoc方式或fstab方式mount这个共享目录

3)     利用cpvmkfstools等工具备份VMtemplate

 

以下为几个常用命令,其中BI-SDS1为对方Windows ServerNetBIOS名称。也即ipconfig /all中的hostname

1)     查询服务器上的共享(口令指定在命令行中)

smbclient -I 192.168.0.239 -N -U administrator%password –L BI-SDS1

Domain=[BI-SDS1] OS=[Windows Server 2003 3790 Service Pack 1] Server=[Windows

rver 2003 5.2]

 

        Sharename       Type      Comment

        ---------       ----      -------

        Backup          Disk

        AimBuffer       Disk

        IPC$            IPC       Remote IPC

        ADMIN$          Disk      Remote Admin

        E$              Disk      Default share

Domain=[BI-SDS1] OS=[Windows Server 2003 3790 Service Pack 1] Server=[Windows

rver 2003 5.2]

 

        Server               Comment

        ---------            -------

 

        Workgroup            Master

        ---------            -------

2)     查询服务器上的共享(口令根据提示输入)

smbclient -I 192.168.0.239 -N -U administrator –L BI-SDS1

3)     mount共享目录

mount -t smbfs -o ip=192.168.0.239,username=Administrator,

password=******** //BI-SDS1/Backup /share

      注意这里指定的共享目录Backup必须与查询时大小写一致。

 

ad hoc 方式:

前面常用命令已经涵盖了

 

fstab方式:

首先编辑/etc/fstab,以下为样例(都在一行)

//BI-SDS1/Backup /share smbfs ip=192.168.0.239,username=Administrator,password=2ghlmcl,noauto 0 0

然后mount /sharemount //BI-SDS1/Backup就可以了。

阅读(482) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~