标签:style c class blog code java
1、系统环境变量
Fedora:
yum install libacl-devel libblkid-devel gnutls-devel readline-devel python-devel gdb pkgconfig libattr-devel krb5-workstation
Debian or Ubuntu:
apt-get install build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev acl
Red Hat Enterprise Linux or CentOS:
yum install gcc libacl-devel libblkid-devel gnutls-devel readline-devel python-devel gdb pkgconfig krb5-workstation zlib-devel setroubleshoot-server libaio-devel setroubleshoot-plugins policycoreutils-python libsemanage-python setools-libs-python setools-libs popt-devel libpcap-devel sqlite-devel libidn-devel libxml2-devel libacl-devel libsepol-devel libattr-devel keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils
我用的CentOS 6.4。
2、编译和安装Samba源文件
从Samba官网http://www.samba.org/下载最新的源代码,进行编译
我下载的是samba-4.1.6, 将下载文件解压,然后进入samba-4.1.6目录中,运行以下命令
./configure make make install #安装
samba的默认安装路径是:/usr/local/samba
/usr/local/samba/sbin/samba
vi /etc/ld.so.conf #打开文件 /usr/local/samba/lib #在文件中添加一行,保存退出 ldconfig #更新动态链接库缓存
#.bash_profile #Get the aliases and functions if[ -f ~/.bashrc ]; then .~/.bashrc fi #User specific environment and startup programs PATH=$PATH:$HOME/bin:/usr/local/samba/bin:/usr/local/samba/sbin export PATH
/usr/local/samba/bin/samba-tool domain provision --use-rfc2307 --interactive
rm -rf /usr/local/samba/etc/smb.conf rm -rf /usr/local/samba/private/*
Realm[BTA.NET.CN]: test.com #域名 Domain[xfs]: test ServerRole (dc, member, standalone) [dc]: dc DNSbackend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE)[SAMBA_INTERNAL]: DNSforwarder IP address (write ‘none‘ to disable forwarding)[202.106.0.20]: Administratorpassword: Retypepassword:
/usr/local/samba/sbin/samba
/usr/local/samba/sbin/samba -V
/usr/local/samba/bin/smbclient --version
$ /usr/local/samba/bin/smbclient -L localhost -U% Sharename Type Comment --------- ---- ------- netlogon Disk sysvol Disk IPC$ IPC IPC Service (Samba 4.x.y)
killall samba /usr/local/samba/sbin/samba
$ smbclient //localhost/netlogon -UAdministrator -c ‘ls‘ Domain=[SAMDOM] OS=[Unix] Server=[Samba 4.x.y] . D 0 Tue Dec 11 20:00:00 2012 .. D 0 Tue Dec 11 20:00:00 2012
domain test.com nameserver 192.168.10.215 #本地IP地址
$ host -t SRV _ldap._tcp.samdom.example.com. _ldap._tcp.samdom.example.com has SRV record 0 100 389 dc1.samdom.example.com. $ host -t SRV _kerberos._udp.samdom.example.com. _kerberos._udp.samdom.example.com has SRV record 0 100 88 dc1.samdom.example.com. $ host -t A dc1.samdom.example.com. dc1.samdom.example.com has address 192.168.10.215
/usr/local/samba/share/setup/krb5
.conf是一个样板文件,你可以将该文件复制并覆盖原来的
krb5.conf文件,并进行修改[libdefaults] default_realm = TEST.COM #大写 dns_lookup_realm = false dns_lookup_kdc = true
kinit administrator@TEST.COM $ klist Ticket cache: FILE:/tmp/krb5cc_1000 Default principal: administrator@SAMDOM.EXAMPLE.COM Valid starting Expires Service principal 04/03/13 19:39:48 04/05/13 19:39:46 krbtgt/TEST.COM@TEST.COM
标签:style c class blog code java
原文地址:http://www.cnblogs.com/Skyar/p/3667957.html