登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

SeaRiver Blog

实力才是你一生最好的依靠!

 
 
 

日志

 
 

Samba安装手顺  

2010-09-29 16:40:54|  分类: samba |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
1.软件下载
  官网:http://samba.org/samba/ftp/stable/samba-3.4.8.tar.gz
  最新版本:samba-3.5.3.tar.gz  //这是最新版本,但不是最稳定版本,所以昨天编译时出一堆错。
                                  这次用的是3.4.8版本,编译没有问题

2.编译安装
[root@localhost yuhj]# tar xzf samba-3.4.8.tar.gz
[root@localhost yuhj]# cd samba-3.4.8
[root@localhost samba-3.4.8]# ls
codepages  docs-xml    lib     m4           merged-branches.txt  packaging4  pidl               README           Roadmap   source4  swat2.txt  tests          WHATSNEW.txt
COPYING    examples    libcli  MAINTAINERS  nsswitch             pcp         prog_guide4.txt    README.Coding    selftest  swat     testdata   testsuite
docs       howto4.txt  librpc  Manifest     packaging            PFIF.txt    Read-Manifest-Now  release-scripts  source3   swat2    testprogs  WHATSNEW4.txt
[root@localhost samba-3.4.8]# ./configure
SAMBA VERSION: 3.4.8
-
-
#    define SAMBA_VERSION_STRING SAMBA_VERSION_OFFICIAL_STRING
LIBREPLACE_LOCATION_CHECKS: START
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
LIBREPLACE_LOCATION_CHECKS: END
LIBREPLACE_CC_CHECKS: START
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for version of gcc... 4.1.2
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
...略
///usr/local/samba/swat/using_samba/figs/sam2_af07.gif
======================================================================
The SWAT files have been installed. Remember to read the documentation
for information on enabling and using SWAT
======================================================================
/usr/bin/install -c bin/libtalloc.so.1 //usr/local/samba/lib
if test -r bin/libtalloc.so.1 ; then \
                ln -f -s `basename bin/libtalloc.so.1` \
                        //usr/local/samba/lib/`basename bin/libtalloc.so` ; \
        fi
: bin/libtalloc.a //usr/local/samba/lib
/usr/bin/install -c -m 0644 /home/yuhj/samba-3.4.8/source3/../lib/talloc/talloc.h //usr/local/samba/include
/usr/bin/install -c bin/libtdb.so.1 //usr/local/samba/lib
if test -r bin/libtdb.so.1 ; then \
                ln -f -s `basename bin/libtdb.so.1` \
                        //usr/local/samba/lib/`basename bin/libtdb.so` ; \
        fi
: bin/libtdb.a //usr/local/samba/lib
/usr/bin/install -c -m 0644 /home/yuhj/samba-3.4.8/source3/../lib/tdb/include/tdb.h //usr/local/samba/include
/usr/bin/install -c bin/libwbclient.so.0 //usr/local/samba/lib
if test -r bin/libwbclient.so.0 ; then \
                ln -f -s `basename bin/libwbclient.so.0` \
                        //usr/local/samba/lib/`basename bin/libwbclient.so` ; \
        fi
/usr/bin/install -c -m 0644 /home/yuhj/samba-3.4.8/source3/../nsswitch/libwbclient/wbclient.h //usr/local/samba/include
/usr/bin/install -c bin/libnetapi.so.0 //usr/local/samba/lib
if test -r bin/libnetapi.so.0 ; then \
                ln -f -s `basename bin/libnetapi.so.0` \
                        //usr/local/samba/lib/`basename bin/libnetapi.so` ; \
        fi
: bin/libnetapi.a //usr/local/samba/lib
/usr/bin/install -c -m 0644 /home/yuhj/samba-3.4.8/source3/lib/netapi/netapi.h //usr/local/samba/include
/usr/bin/install -c bin/libsmbclient.so.0 //usr/local/samba/lib
if test -r bin/libsmbclient.so.0 ; then \
                ln -f -s `basename bin/libsmbclient.so.0` \
                        //usr/local/samba/lib/`basename bin/libsmbclient.so` ; \
        fi
: bin/libsmbclient.a //usr/local/samba/lib
/usr/bin/install -c -m 0644 /home/yuhj/samba-3.4.8/source3/include/libsmbclient.h //usr/local/samba/include
/usr/bin/install -c bin/libsmbsharemodes.so.0 //usr/local/samba/lib
if test -r bin/libsmbsharemodes.so.0 ; then \
                ln -f -s `basename bin/libsmbsharemodes.so.0` \
                        //usr/local/samba/lib/`basename bin/libsmbsharemodes.so` ; \
        fi
: bin/libsmbsharemodes.a //usr/local/samba/lib
/usr/bin/install -c -m 0644 /home/yuhj/samba-3.4.8/source3/include/smb_share_modes.h //usr/local/samba/include
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/ar.po as ///usr/local/samba/share/locale/ar/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/cs.po as ///usr/local/samba/share/locale/cs/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/da.po as ///usr/local/samba/share/locale/da/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/de.po as ///usr/local/samba/share/locale/de/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/es.po as ///usr/local/samba/share/locale/es/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/fi.po as ///usr/local/samba/share/locale/fi/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/fr.po as ///usr/local/samba/share/locale/fr/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/hu.po as ///usr/local/samba/share/locale/hu/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/it.po as ///usr/local/samba/share/locale/it/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/ja.po as ///usr/local/samba/share/locale/ja/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/ko.po as ///usr/local/samba/share/locale/ko/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/nb.po as ///usr/local/samba/share/locale/nb/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/nl.po as ///usr/local/samba/share/locale/nl/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/pl.po as ///usr/local/samba/share/locale/pl/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/pt_BR.po as ///usr/local/samba/share/locale/pt_BR/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/ru.po as ///usr/local/samba/share/locale/ru/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/sv.po as ///usr/local/samba/share/locale/sv/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/zh_CN.po as ///usr/local/samba/share/locale/zh_CN/LC_MESSAGES/pam_winbind.mo
Installing /home/yuhj/samba-3.4.8/source3//locale/pam_winbind/zh_TW.po as ///usr/local/samba/share/locale/zh_TW/LC_MESSAGES/pam_winbind.mo
==============================================================
MO files for pam_winbind are installed.
==============================================================
==============================================================
All MO files for Samba are installed. You can use "make uninstall"
or "make uninstallmo" to remove them.
==============================================================
[root@localhost source3]#


3.配置sam.conf
[root@localhost etc]# vi smb.conf
[global]
Workgroup=localdomain                  #工作组名
Server string=samba server(Yuhj)       #samba服务器的注释说明

Security=user                                     #设置安全模式,此处是需要登录时输入用户名和密码
Encrypt passwords=yes                             #使用加密密码方式
Smb passwd file=/usr/local/samba/etc/smbpasswd    #samba密码文件


[home]
Comment=Yuhj Home Directors           #对共享目录说明
Browseable=no                         #是否允许用户浏览所有人的主目录,即homes目录
Writable=yes                          #是否允许写入个人主目录
path = /home/yuhj/                    #共享目录

[share]
Comment=Share Home Directors
Path=/home/share
Writable=yes

4.测试配置,出现以下错误:
问题1:
[root@localhost bin]# ./testparm
./testparm: error while loading shared libraries: libtalloc.so.1: cannot open shared object file: No such file or directory

解决方法:
[root@localhost sbin]# cp /home/yuhj/samba-3.4.8/source3/bin/libtalloc.so.1 /usr/lib64/

问题2:
root@localhost bin]# ./testparm
./testparm: error while loading shared libraries: libtdb.so.1: cannot open shared object file: No such file or directory

解决方法:
[root@localhost bin]# cp /home/yuhj/samba-3.4.8/source3/bin/libtdb.so.1 /usr/lib64/

测试OK:
[root@localhost bin]# ./testparm
Load smb config files from /usr/local/samba/lib/smb.conf
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
Processing section "[home]"
Processing section "[share]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        server string = samba server(Yuhj)
        smb passwd file = /usr/local/samba/etc/smbpasswd

[home]
        comment = Yuhj Home Directors
        path = /home/yuhj/
        read only = No
        browseable = No
        browsable = No

[share]
        comment = Share Home Directors
        path = /home/share
        read only = No

4.启动服务
[root@localhost yuhj]# service smb start
Starting SMB services: [  OK  ]
Starting NMB services: [  OK  ]


5.linux端连接测试:
[root@localhost bin]# ./smbclient //172.18.5.60/home/yuhj -U yuhj
Enter yuhj's password:
session setup failed: NT_STATUS_LOGON_FAILURE             //用户验证失败,说明还没有创建用户或用户口令错误,下面创建用户

6.添加用户
[root@localhost bin]# ./smbpasswd -a yuhj
New SMB password:
Retype new SMB password:
Added user yuhj.
[root@localhost bin]# ./smbclient //172.18.5.60/home/yuhj/ -U yuhj
Enter yuhj's password:
Domain=[LOCALDOMAIN] OS=[Unix] Server=[Samba 3.4.8]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME          //原因就是目录不存.

7.连接测试OK
[root@localhost bin]# ./smbclient //172.18.5.60/home -U yuhj
Enter yuhj's password:
Domain=[LOCALDOMAIN] OS=[Unix] Server=[Samba 3.4.8]
smb: \> ls
  .                                   D        0  Sat Jun  5 01:27:11 2010
  ..                                  D        0  Fri Jun  4 01:44:39 2010
  .zshrc                              H      658  Thu Jun  3 23:06:23 2010
  .emacs                              H      515  Thu Jun  3 23:06:23 2010
  .bash_profile                       H      176  Thu Jun  3 23:06:23 2010
  .mozilla                           DH        0  Thu Jun  3 23:06:23 2010
  samba-3.5.3                         D        0  Fri Jun  4 01:56:45 2010
  .bashrc                             H      124  Thu Jun  3 23:06:23 2010
  samba-3.4.8.tar.gz                    34851288  Tue May 11 17:23:07 2010
  samba-3.5.3.tar.gz                    30801998  Thu Jun  3 15:55:12 2010
  yuhaijiang                          D        0  Sat Jun  5 01:26:32 2010
  .kde                               DH        0  Thu Jun  3 23:06:23 2010
  samba-3.4.8                         D        0  Mon May 10 22:04:37 2010
  .bash_logout                        H       33  Thu Jun  3 23:06:23 2010

                34974 blocks of size 2097152. 28019 blocks available
smb: \>

8.windows端连接测试
开始菜单——>“运行”中输入 \\服务器IP --> 输入ID/PW

窗口或浏览器的地址栏中输入 \\服务器IP --> 输入ID/PW

我在windows端连接后,创建了一个test目录。
[root@localhost bin]#  ./smbclient //172.18.5.60/home -U yuhj
Enter yuhj's password:
Domain=[LOCALDOMAIN] OS=[Unix] Server=[Samba 3.0.33-3.14.el5]
smb: \> ls test
  test                                D        0  Sat Jun  5 01:50:10 2010

                34974 blocks of size 2097152. 28019 blocks available
smb: \>

已经创建成功。
  评论这张
 
阅读(2771)| 评论(1)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018