我们这里以samba3.6.1为例说明,按照本文方法一步步来,肯定是可以成功的。
【samba安装方法】
$ tar xzvf samba-latest.tar.gz
$ cd samba-3.6.1/source3/
$ ./configure
$ make
$ make install
$ cp -R /usr/local/samba/lib/* /usr/lib/
$ cp /usr/local/samba/bin/* /usr/bin/
$ cp /usr/local/samba/sbin/* /usr/sbin/
$ cp samba-3.6.1/examples/smb.conf.default /usr/local/samba/lib/smb.conf /*这里的目录好象不对*/
$ vi /usr/local/samba/lib/smb.conf
[global]
[wangfeng]
comment = /home/wangfeng
path = /home/wangfeng
public = no
valid users = wangfeng
browseable = Yes
read only = no
inherit acls = Yes
create mode = 0755
directory mode = 0755
#invalid users = guest
:wq!
$ cd /usr/local/samba/
$ vi restart.sh
#!/bin/sh
ps aux | grep "nmbd" | awk '{print $2}' | xargs kill -9
ps aux | grep "smbd" | awk '{print $2}' | xargs kill -9
ps aux | grep "winbindd" | awk '{print $2}' | xargs kill -9
nmbd -D
smbd -D
winbindd -D
:wq!
#chmod a+x restart.sh
#./restart.sh
然后检查smb的进程启动没有这个是增加用户,这个用户必需是在系统中存在的
$ smbpasswd wangfeng -a #add samba user
New SMB password:
Retype new SMB password:
Added user wangfeng.
如果windows连接不上,在linux下执行iptables -F试试这时就可以在windows上将linux上的目录影射为windows的目录,链接方法:
windows 网络选择右键:映射网络驱动器 \\192.168.0.104\wangfeng