Samba是一个功能强大的软件工具,它可以让基于linux操作系统的计算机系统和基于Windows的计算机系统相互通讯 安装如下rpm包就行了 [root@FC4103 ~]# rpm -qa|grep samba
system-config-samba-1.2.31-1
samba-common-3.0.14a-2
samba-client-3.0.14a-2
samba-3.0.14a-2
[root@FC4103 ~]# 修改smb.conf,找到"encrypt passwords = yes"和"smb passwd file = /etc/samba/smbpasswd"这两行,把前面的“;”去掉,运行smbpasswd -a root,设置samba里root用户的密码,以后要修改运行smbpasswd root即可(第一次要用-a选项),启动smbd和nmbd进程(直接#smbd,#smbd或者service smb start) 1.linux连接到windows的共享目录
[root@FC103 ~]# smbclient //192.168.18.55/test -U administrator
Password: #输入adminstrator的密码
Domain=[35-LIUKM] OS=[Windows Server 2003 3790] Server=[Windows Server 2003 5.2]
smb: \> ls
. D 0 Tue Apr 4 01:35:20 2006
.. D 0 Tue Apr 4 01:35:20 2006
test.txt A 11 Tue Apr 4 01:37:06 2006 39985 blocks of size 524288. 6255 blocks available
smb: \> more test.txt
getting file \test.txt of size 11 as /tmp/smbmore.hh3gLe (0.4 kb/s) (average 0.4 kb/s)
Just a test
smb: \> ?
? altname archive blocksize cancel
case_sensitive cd chmod chown del
dir du exit get getfacl
hardlink help history lcd link
lowercase ls mask md mget
mkdir more mput newer open
print printmode prompt put pwd
q queue quit rd recurse
reget rename reput rm rmdir
setmode stat symlink tar tarmode
translate vuid logon listconnect showconnect
!
smb: \> 2.windows连接linux共享 在/etc/samba/smb.conf中加入如下内容 guest ok = yes
map to guest = Bad User
map to guest = bad password
guest account= nobody 如果不加guest account=nobody,默认也是nobody登陆的!这个可以根据具体情况选择用特定的帐户,主要是结合权限! 设定一个public目录,运行\\192.168.200.103就可以打开public的,再设定一个需要输入用户名和密码才可以登陆的目录如rootdir,另设定一个用户登陆进去后可以看到自己的家目录的 [public]
comment = Public Stuff
path = /km/
public = yes
read only = yes
write list = @staff [rootdir]
comment = root's Service
path = /root/
valid users = root
public = no
writable = yes
printable = no [homes]
comment = Home Directories
browseable = no
writable = yes |