当前位置:首页 » 云服务器 » ad域搭建共享文件服务器

ad域搭建共享文件服务器

发布时间: 2023-01-10 03:48:11

㈠ samba如何加入ad域搭建文件共享

1、安装所需软件:

# yum -y install samba samba-client samba-common samba-winbind samba-winbind-clients krb5-workstation ntpdate
2、设置服务自启动并启动服务:

# chkconfig smb on
# chkconfig winbind on
# service smb start
# service winbind start
3、修改 /etc/hosts 文件,添加主机对应记录:

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain
192.168.2.150 lemon20.contoso.com
4、设置 DNS 地址并与 AD 服务器同步时间:

# echo "192.168.44.108" >> /etc/resolv.conf
# ntpdate ad.contoso.com
5、设置 Kerberos 票据(可选):

销毁已经存在的所有票据:

# kdestroy
查看当前是否还存在票据:

# klist klist: No credentials cache found (ticket cache FILE:/tmp/krb5cc_0)
生成新的票据,注意域名大写。
#kinit [email protected] #检查krb5能否正确请求kerbroes票据

6、以命令方式设置 samba 与 Kerberos,并加入 AD 域:

#authconfig --enablewinbind --enablewins --enablewinbindauth --smbsecurity domain --smbworkgroup=CONTOSO --smbrealm CONTOSO.COM --smbservers=ad.contoso.com --enablekrb5 --krb5realm=CONTOSO.COM --krb5kdc=ad.contoso.com --krb5adminserver=ad.contoso.com --enablekrb5kdcdns --enablekrb5realmdns --enablewinbindoffline --winbindtemplateshell=/bin/bash --winbindjoin=administrator --update --enablelocauthorize --enablemkhomedir --enablewinbinsedefaultdomain
注意命令中的大小写,此步骤也可以使用 authconfig-tui 完成,加入后会提示No DNS domain configured for pmsamba. Unable to perform DNS Update.
DNS update failed: NT_STATUS_INVALID_PARAMETER ,此警告可以忽略!
7、增加 sudo 权限(可选):

# visudo
加入下列设置:

%MYDOMAIN//domain/ admins ALL=(ALL) NOPASSWD: ALL
8、确认是否正确加入 AD 域:

查看 AD 的相关信息

# net ads info
# wbinfo -u
#wbinfo -t
#wbinfo -g
#getent passwd
#getent group
#testparm #测试smb.conf是否正确
问题排错:
Cannot find KDC for requested realm while getting initial credentials dns未正确指向
KDC reply did not match expectations while getting initial credentials 域名不对或者时间不同步
一般检测会提示:
WARNING: The setting 'security=ads' should NOT be combined with the 'password server' parameter.
(by default Samba will discover the correct DC to contact automatically).
系统认为己设置了“security = ADS”就不必设置“password server =”因为samba会自己认到,可以忽略此警告!

㈡ 在AD域中建立了一个文件服务器,在服务器中建立一文件共享

让demo是拥有者就可以了

热点内容
中国电信的电视维护密码是多少 发布:2025-05-10 04:36:52 浏览:589
苹果编译器叫什么名字 发布:2025-05-10 04:36:44 浏览:544
怎么给电话配置ip 发布:2025-05-10 04:31:40 浏览:359
java访问网站 发布:2025-05-10 04:31:02 浏览:189
linuxshell命令行 发布:2025-05-10 04:16:12 浏览:751
广东人社账号密码多少 发布:2025-05-10 03:43:11 浏览:617
python对象参数 发布:2025-05-10 03:43:11 浏览:576
自己服务器搭建梯子 发布:2025-05-10 03:31:39 浏览:574
华为升级包怎么解压 发布:2025-05-10 03:18:24 浏览:604
c语言以什么结束 发布:2025-05-10 03:18:22 浏览:258