# tar -zxvf samba-3.3.4.tar.gz
# cd samba-3.3.4
# find . -name configure
# cd source/
# mkdir /usr/local/samba
# ./configure --prefix=/usr/local/samba/
# make
# make install
# cd /usr/local/samba/
# mkdir etc
# cp /root/samba/samba-3.3.4/examples/smb.conf.default ./etc/smb.conf
# cd /usr/local/samba/etc/
# cp smb.conf beifen 备份一下免得改错了。
修改smb.conf,
workgroup = MSHOME 改为你linux所在的工作组
security = share 开放共享
在smb.conf最后加上
[readmy]
comment = readmy
path = /home/dkcn
public = yes
guest ok = yes
writable = yes
创建共享目录
# adduser dkcn 创建系统用户
# /usr/local/samba/bin/smbpasswd -a dkcn 再把这个用户添加为samba用户
Can't load /usr/local/samba/lib/smb.conf - run testparm to debug it 怎么出错了,好像没有在lib下没有smb.conf,那我就加上吧
# cp /usr/local/samba/etc/smb.conf /usr/local/samba/lib/
# /usr/local/samba/bin/smbpasswd -a dkcn 添加samba用户成功
New SMB password:
Retype new SMB password:
startsmbfilepwent_internal: file /usr/local/samba//private/smbpasswd did not exist. File successfully created.
Added user dkcn.
# service iptables stop
# service network restart
# /usr/local/samba/sbin/smbd -D 启动samba的二个进程
# /usr/local/samba/sbin/nmbd -D
到win-xp下,打开我的电脑,输入\linux主机名,可以找到共享的目录readmy,成功。
测试samba设置时用到的命令:
显示关于计算机连接的信息
C:\Documents and Settings\USER>net use
删除远程连接session的命令
C:\Documents and Settings\USER>net use * /del