本文只是个人心得,如有错误请指正。此文不讨论什么是samba。
Fedora
1. 先在Fedora里查找一下是否已经安装了samba rpm包 (此步骤可选)
rpm -qa | grep “samba”
注: 如果你想卸载已有的rpm包,可执行以下指令:
rpm -e rpm_name
2. 到[/url]http://download.fedora.redhat.com/pub/fedora/linux/core/development/i386/Fedora/RPMS/ 下载 [url=http://download.fedora.redhat.com/pub/fedora/linux/core/development/i386/Fedora/RPMS/samba-3.0.3-5.i386.rpm]samba-3.0.3-5.i386.rpm, samba-client-3.0.3-5.i386.rpm, 和 samba-common-3.0.3-5.i386.rpm 三个rpm包。
3. 把samba-common rpm升级到3.0.3-5
rpm -Uvh samba-common-3.0.3-5.i386.rpm
4. 安装samba 3.0.3-5 和 samba-client
rpm -i samba-3.0.3-5.i385.rpm
rpm -i samba-client-3.0.3-5.i386.rpm
注: 如果你成功安装了samba,在"/etc/rc.d/init.d” 目录下会有一个"smb" shell脚本文件.
5. 执行“chkconfig --list”指令,检测smb service是否已经在Fedora的service列表中.
6. 如果没有,用“chkconfig --add smb”添加smb service.
7. 用"chkconfig --level 35 smb on”指令把samba service在第三和第五运行级别打开 (不知道具体细节没有关系)。 这样,每次Fedora重新启动都会自动开启samba service.
8. 配制你的 /etc/samba/smb.conf 文件. 这里是我的smb.conf例子:
[global]
workgroup = WORKGROUP
server string = My-Serv
netbios name = My-Serv
log file = /var/log/samba/%m.log
max log size = 50
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
unix password sync = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
pam password change = yes
obey pam restrictions = yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
wins support = yes
dns proxy = no
#======================== Share Definitions ===========================
[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775
[public]
path = /public
public = yes
only guest = yes
writable = yes
printable = no
9. 运行"testparm”以检测smb.conf文件是否有错.
10. 执行 “service smb restart” 重新启动samba.
11. 确认Fedora的Firewall没有禁止samba的文件共享.
Windows
1. 你的PC必须在"Workgroup”这个group里,这是由smb.conf中workgroup = WORKGROUP所确定的.
2. 在My Computer下打开My Network Places. 在"Workgroup”下你应该找到My-Serv.
3. 把"L:" drive映射到 \My-Servhomes ,"L:" drive放你个人的资料,他人没有密码不能访问.
4. 把"P: " drive映射到 \My-Servpublic ,"P:" drive存放公用的文件。
从此,你将能够在Fedora和Windows间共享文件。