TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
Nâng cấp domain controller
1. Chuẩn bị
Đặt tên máy
# vi /etc/sysconfig/network
HOSTNAME=dc1.nhatnghe1.com
Sủa file hosts
#vi /etc/hosts
192.168.1.11 dc1.nhatnghe1.com dc1
Khai báo dns
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
#UUID=87261f51-1ff9-4fa6-b95b-163560b266e7
ONBOOT=yes
#NM_CONTROLLED=yes
BOOTPROTO=none
#HWADDR=00:0C:29:A4:04:50
IPADDR=192.168.1.11
PREFIX=24
GATEWAY=192.168.1.254
DNS1=192.168.1.11
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
Kiểm tra gói krb5
[root@dc1 ~]# rpm -qa | grep krb5
krb5-workstation-1.10.3-33.el6.x86_64
krb5-devel-1.10.3-33.el6.x86_64
sssd-krb5-1.11.6-30.el6.x86_64
sssd-krb5-common-1.11.6-30.el6.x86_64
krb5-libs-1.10.3-33.el6.x86_64
pam_krb5-2.3.11-9.el6.x86_64
Kiểm tra gói samba, nếu có tiến hành gỡ bỏ
Khởi động lại máy tính
# shutdown -r now
Biên dịch và cài samba
#tar xzvf samba-4.2.2.tar.gz
# cd samba-4.2.2
# ./configure --enable-debug --enable-selftest
#make
# make install
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
1
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
2. Provision Samba 4
# /usr/local/samba/bin/samba-tool domain provision
# /usr/local/samba/bin/samba-tool domain provision
Realm [NHATNGHE1.COM]: enter
Domain [NHATNGHE1]: enter
Server Role (dc, member, standalone) [dc]: enter
DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]: enter
DNS forwarder IP address (write 'none' to disable forwarding) [192.168.1.11]: 8.8.8.8
Administrator password: P@ssword
Retype password: P@ssword
Looking up IPv4 addresses
Looking up IPv6 addresses
No IPv6 address will be assigned
Setting up share.ldb
Setting up secrets.ldb
Setting up the registry
Setting up the privileges database
Setting up idmap db
Setting up SAM db
Setting up sam.ldb partitions and settings
Setting up sam.ldb rootDSE
Pre-loading the Samba 4 and AD schema
Adding DomainDN: DC=nhatnghe1,DC=com
Adding configuration container
Setting up sam.ldb schema
Setting up sam.ldb configuration data
Setting up display specifiers
Modifying display specifiers
Adding users container
Modifying users container
Adding computers container
Modifying computers container
Setting up sam.ldb data
Setting up well known security principals
Setting up sam.ldb users and groups
Setting up self join
Adding DNS accounts
Creating CN=MicrosoftDNS,CN=System,DC=nhatnghe1,DC=com
Creating DomainDnsZones and ForestDnsZones partitions
Populating DomainDnsZones and ForestDnsZones partitions
Setting up sam.ldb rootDSE marking as synchronized
Fixing provision GUIDs
A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf
Once the above files are installed, your Samba4 server will be ready to use
Server Role:
active directory domain controller
Hostname:
dc1
NetBIOS Domain:
NHATNGHE1
DNS Domain:
nhatnghe1.com
DOMAIN SID:
S-1-5-21-3707963530-2315394421-2394645435
reboot the server
# shutdown -r now
3. Khởi động Samba 4 AD DC
# /usr/local/samba/sbin/samba
Khởi động samba khi boot
# vi /usr/local/samba/sbin/samba
/usr/local/samba/sbin/samba
2
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
4. Kiểm tra Active Directory DC
Testing version of Samba
# /usr/local/samba/sbin/samba -V
Version 4.2.2
Verify you are running the correct samba-client version
# /usr/local/samba/bin/smbclient --version
Version 4.2.2
Xem các tài nguyên share trên máy Samba4 server
# /usr/local/samba/bin/smbclient -L localhost -U%
Domain=[NHATNGHE1] OS=[Windows 6.1] Server=[Samba 4.2.2]
Sharename
--------netlogon
sysvol
IPC$
Type
---Disk
Disk
IPC
Comment
-------
IPC Service (Samba 4.2.2)
Domain=[NHATNGHE1] OS=[Windows 6.1] Server=[Samba 4.2.2]
Server
Comment
--------------Workgroup
Master
--------------Xem file cấu hình smb.conf:
# cat /usr/local/samba/etc/smb.conf
# cat /usr/local/samba/etc/smb.conf
# Global parameters
[global]
workgroup = NHATNGHE1
realm = NHATNGHE1.COM
netbios name = DC1
server role = active directory domain controller
dns forwarder = 8.8.8.8
[netlogon]
path = /usr/local/samba/var/locks/sysvol/nhatnghe1.com/scripts
read only = No
[sysvol]
path = /usr/local/samba/var/locks/sysvol
read only = No
[root@dc1 ~]#
5. Kiểm tra DNS
# host -t SRV _ldap._tcp.nhatnghe1.com.
_ldap._tcp.nhatnghe1.com has SRV record 0 100 389 dc1.nhatnghe1.com.
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
3
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
# host -t SRV _kerberos._udp.nhatnghe1.com.
_kerberos._udp.nhatnghe1.com has SRV record 0 100 88 dc1.nhatnghe1.com.
# host -t A dc1.nhatnghe1.com.
dc1.nhatnghe1.com has address 192.168.1.11
6. Cấu hình Kerberos
Sửa file krb5.conf
# vi /etc/krb5.conf
7 default_realm = NHATNGHE1.COM
8 dns_lookup_realm = false
9 dns_lookup_kdc = true
Kiểm tra Kerberos
# kinit
Password for : P@ssword
Warning: Your password will expire in 41 days on Wed Jul 22 14:51:03 2015
# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal:
Valid starting Expires
Service principal
06/10/15 15:16:12 06/11/15 01:16:12 krbtgt/
renew until 06/17/15 15:16:08
7. NTP (Network Time Protocol)
# /etc/init.d/ntpd status
ntpd (pid 1577) is running...
# chkconfig ntpd on
8. Configure Windows Client to Join Domain
Lan card: DNS chỉ về máy samba
4
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
Ping kiểm tra hoạt động DNS
Chỉnh thời gian trên win 7 đúng với máy samba
Tiến hành join domain:
1. Right-click 'My Computer' icon and choose 'Properties'
2. From the left-side pane click 'Advanced system settings'
3. Choose the 'Computer Name' tab and click 'Change...'
4. Select option 'Domain', and insert nhatnghe1.com.
Nhập user: administrator, password: P@ssword
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
5
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
Reboot
Login vào domain vối user administrator
9. Install Windows Remote Administration Tools
Cài đặt RSAT-WIN7-x64.msu
Enable các thành phần cần thiết Control Panel -> Programs features -> Turn Windows features on or
off -> Remote Server Administration Tools'
6
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
Mở ADUC:dsa.msc
10. Password policy
Xem chính sách password hiện tại
# samba-tool domain passwordsettings show
Password informations for domain 'DC=nhatnghe1,DC=com'
Password complexity: on
Store plaintext passwords: off
Password history length: 24
Minimum password length: 7
Minimum password age (days): 1
Maximum password age (days): 42
Account lockout duration (mins): 30
Account lockout threshold (attempts): 0
Reset account lockout after (mins): 30
Xem các tham số password :
# samba-tool domain passwordsettings set –help
--complexity=COMPLEXITY
The password complexity (on | off | default). Default is 'on'
--store-plaintext=STORE_PLAINTEXT
Store plaintext passwords where account have 'store
passwords with reversible encryption' set (on | off | default). Default is 'off'
--history-length=HISTORY_LENGTH
The password history length (<integer> | default). Default is 24.
--min-pwd-length=MIN_PWD_LENGTH
The minimum password length (<integer> | default).
Default is 7.
--min-pwd-age=MIN_PWD_AGE
The minimum password age (<integer in days> | default). Default is 1.
--max-pwd-age=MAX_PWD_AGE
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
7
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
The maximum password age (<integer in days> | default). Default is 43.
--account-lockout-duration=ACCOUNT_LOCKOUT_DURATION
The the length of time an account is locked out after
exeeding the limit on bad password attempts (
in mins> | default). Default is 30 mins.
--account-lockout-threshold=ACCOUNT_LOCKOUT_THRESHOLD
The number of bad password attempts allowed before
locking out the account (<integer> | default).
Default is 0 (never lock out).
--reset-account-lockout-after=RESET_ACCOUNT_LOCKOUT_AFTER
After this time is elapsed, the recorded number of
attempts restarts from zero (<integer> | default).
Default is 30.
Ví dụ:
#samba-tool domain passwordsettings set --complexity off
#samba-tool domain passwordsettings set --history-length 3
#samba-tool domain passwordsettings set --min-pwd-length 3
#samba-tool domain passwordsettings set --min-pwd-age 0
#samba-tool domain passwordsettings set --max-pwd-age 999
#samba-tool domain passwordsettings show
Password complexity: off
Store plaintext passwords: off
Password history length: 3
Minimum password length: 3
Minimum password age (days): 0
Maximum password age (days): 999
Account lockout duration (mins): 30
Account lockout threshold (attempts): 0
Reset account lockout after (mins): 30
Quản lý Password của administrator
+ Xem kiểu mã hóa của session key và ticket
# klist -e
Ticket cache: FILE:/tmp/krb5cc_0
Default principal:
Valid starting Expires
Service principal
06/10/15 15:16:12 06/11/15 01:16:12
krbtgt/
renew until 06/17/15 15:16:08, Etype (skey, tkt): aes256-cts-hmac-sha1-96,
aes256-cts-hmac-sha1-96
+ Change the current administrator password
# kpasswd
Password for :
Enter new password: P@ssword
Enter it again: 111
8
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
Password changed.111
+ Reset Administrator Password
# samba-tool user setpassword Administrator
New Password: 222
Changed password OK
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
9
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
Setup a Samba AD Member Server
Đặt tên host
vi /etc/sysconfig/network
HOSTNAME=member1.nhatnghe1.com
Sửa file /etc/hosts
192.168.1.15
member1.nhatnghe1.com member1
Sửa file /etc/resolv.conf
search nhatnghe1.com
nameserver 192.168.1.11
reboot
Đồng bộ giờ giữa DC và member
Kiểm tra các gói samba (có thể cài gói samba 3.6)
# rpm -qa | grep samba
samba4-libs-4.0.0-64.el6.rc4.x86_64
samba4-common-4.0.0-64.el6.rc4.x86_64
samba4-client-4.0.0-64.el6.rc4.x86_64
samba4-winbind-4.0.0-64.el6.rc4.x86_64
samba4-4.0.0-64.el6.rc4.x86_64
samba4-swat-4.0.0-64.el6.rc4.x86_64
samba4-winbind-clients-4.0.0-64.el6.rc4.x86_64
10
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
Chọn Yes
Nhập paswword 123
Thay nội dung file /etc/samba/smb.conf bằng (neu su dung file cau hinh cu ma ko thanh cong)
[global]
netbios name = Member1
workgroup = NHATNGHE1
security = ADS
realm = NHATNGHE1.COM
#dedicated keytab file = /etc/krb5.keytab
#kerberos method = secrets and keytab
idmap config *:backend = tdb
idmap config *:range = 2000-9999
idmap config NHATNGHE1:backend = ad
idmap config NHATNGHE1:schema_mode = rfc2307
idmap config NHATNGHE1:range = 10000-99999
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
11
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
winbind nss info = rfc2307
winbind trusted domains only = no
winbind use default domain = yes
winbind enum users = yes
winbind enum groups = yes
winbind refresh tickets = Yes
[ketoan]
path = /data/ketoan
read only = no
valid users = +NHATNGHE1\g.ketoan
#mkdir /data/ketoan
#chmod 777 /data/ketoan
Khởi động các service
/etc/init.d/smb restart
/etc/init.d/winbind restart
/etc/init.d/nmb restart
[root@member1 ~]# chkconfig smb on
[root@member1 ~]# chkconfig winbind on
[root@member1 ~]# chkconfig nmb on
Thêm member1 vào DNS
[root@dc1 samba-4.2.2]# samba-tool dns add dc1 nhatnghe1.com member1 A 192.168.1.15 Uadministrator
Password for [NHATNGHE1\administrator]:
Record added successfully
[root@dc1 samba-4.2.2]# host -t A member1.nhatnghe1.com
member1.nhatnghe1.com has address 192.168.1.15
Kiểm tra user, group
[root@member1 ~]# wbinfo -u
NHATNGHE1\administrator
NHATNGHE1\krbtgt
NHATNGHE1\guest
NHATNGHE1\u1
NHATNGHE1\u2
NHATNGHE1\kt1
NHATNGHE1\kt2
NHATNGHE1\kt3
[root@member1 ~]# wbinfo -g
NHATNGHE1\allowed rodc password replication group
NHATNGHE1\enterprise read-only domain controllers
NHATNGHE1\denied rodc password replication group
NHATNGHE1\read-only domain controllers
NHATNGHE1\group policy creator owners
12
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
NHATNGHE1\ras and ias servers
NHATNGHE1\domain controllers
NHATNGHE1\enterprise admins
NHATNGHE1\domain computers
NHATNGHE1\cert publishers
NHATNGHE1\dnsupdateproxy
NHATNGHE1\domain admins
NHATNGHE1\domain guests
NHATNGHE1\schema admins
NHATNGHE1\supporters
NHATNGHE1\domain users
NHATNGHE1\dnsadmins
Xóa cache winbind khi chưa đồng bộ kịp giữa member và dc:
Cách 1:
service winbind stop
service smb stop
rm -f /var/lib/samba/*.tdb
rm -f /var/lib/samba/group_mapping.ldb
service smb start
service winbind start
wbinfo –u
Cách 2:
service winbind stop
service smb stop
net cache flush
service smb start
service winbind start
wbinfo –u
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
13
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
Share permissions
Chuẩn bị
Tạo cây thư mục sau trên máy DC
#mkdir –p /data/{ketoan,kinhdoanh,dungchung,software}
Tạo user, group
g.ketoan(kt1,kt2)
g.kinhdoanh(kd1,kd2)
1. Tạo share folder
Thêm vào cuối file
# vi /usr/local/samba/etc/smb.conf
[Ketoan]
comment = du lieu phong ke toan
path = /data/ketoan
read only = no
[Kinhdoanh]
comment = du lieu phong kinh doanh
path = /data/kinhdoanh
read only = no
[Dungchung]
comment = du lieu dung chung
path = /data/dungchung
read only = no
[Software]
comment = Phan mem co ban
path = /data/software
read only = yes
Reload Samba:
# smbcontrol all reload-config
2. Share thư mục /data/ketoan
Chỉ user phòng kế toán được truy cập, user nào tạo thì chỉ user đó mới có quyền xóa
Tại win 2k8. Login với user administrator
Start, run \\dc1
Click ketoan, chọn properties, security, edit
Remove everyone
Add group g.ketoan
14
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
Gán quyền cho group g.ketoan: write, read,
list, execute
Chọn ok, ok
3. Share thư mục /data/kinhdoanh
Chỉ user phòng kinh doanh được truy cập, mọi user có quyền xóa
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
15
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
Click kinhdoanh, chọn properties, security,
edit
Remove everyone
Add group g.kinhdoanh
Chọn modify
OK
4. Share thư mục /data/dungchung
Chỉ user phòng kinh doanh được truy cập, mọi
user có quyền xóa
Click dungchung, chọn properties, security,
edit
Remove everyone
Add group g.kinhdoanh, g.ketoan
Chọn modify
OK
5. Logon script
Tao file login.bat
net use m: \\dc1\software
net use n: \\dc1\Ketoan
net use o: \\dc1\Dungchung
Tạo policy logon cho OU Ketoan chi đến file login.bat
16
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
Gpupdate /force
Máy client login với user kt1 sẽ thấy các ổ đĩa ánh xạ
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
17
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
Quản trị user group
I. Quản trị user
1. Tạo – sử dụng User Template
B1 Mở Active Directory User And Computer Tạo user NS1 với password 123
- Tạo group g.nhansu
- Ấn dịnh thuộc tính Departerment cho ns1
- Add user NS1 vào Group NhanSu
B2 : Chuột phải user NS1 Chọn Properties
- Trong tab Account phần Account options
Chọn Account is disabled OK
B3 : Chuột phải lên user account NS1 chọn B4 : Full Name : NS2 User logon name : NS2 c
Copy
Next
18
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
B5 : Gõ 123 trong 2 phần Password và confirm B6 : Chọn finish
password Bỏ dấu chọn Account is Disable
Chọn Next
B7 : Thực hiện tương tự B3 - >B7 để copy NS1 thành account NS3/password 123
B8 : Kiểm tra :
- Thuộc tính của cả 2 user NS2 và NS3 giống NS1 :
* Cả 2 user NS2 và NS3 đều được đưa vào group NhanSu
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
19
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
* Cả 2 user NS2 và NS3 đều có thuộc tính giống ns1
2. Làm việc với Multi User
B1 : Giữ phím CTRL lần lượt click chuột
chọn NS1 , NS2 , NS3 Chuột phải Chọn
Properties
B2 : Qua tab Account Đánh dấu chọn trước dòng
Logon hours Chọn Logon hours Logon hours
B3 :
Tô xanh vùng từ 8 – 5 / Sunday
Friday Chọn OK OK
20
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
B4 : Kiểm tra : lần lượt mở
Properties của cả 3 user : NS1 , NS2
, NS3 Qua tab Account Chọn
Logon Hours…
B5 : Quan sát thấy cả 3 user account
Ns1 , NS2 , NS3 đểu được chỉnh thời
gian được phép đăng nhập vào máy
tính
3. Xem toàn bộ thuộc tính của User
B1 : Tại chương trình Active Directory User and
B2 : Chuột phải lên user NS1 Chọn
Computer Chọn Menu View Chọn Advanced Properties
Features
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
21
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
B2 : Chọn Tab Attribute Editor Kiếm mục homeDirectory và ProfilePath Quan sát thấy giá trị
trong 2 dòng này giống trong tab Profile
Nhận xét : Mọi thuộc tính của user account đểu có thể được xem và chỉnh sửa tại Attribute Editor
Thực hành: lần lượt thử với các thuộc tính restriction
. user cannot change password
. disable
. logon hours
. Logon to
II. Quản trị group
Chuẩn bị:
- Tạo OU Nhatnghe
- Trong OU NhatNghe tạo 3 user : U1 , U2 , U3 với password 123
22
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
Thực hiện:
1. Tạo Global group
B1 : Mở Active Directory User and Computer
Chuột phải lên OU Nhatnghe Chọn New
Group
B2 : Phần Group name : gõ NhanSu
Group scope : Global Chọn OK
Quan sát thấy đã có group NhanSu trong OU
NhatNghe
2. Ủy quyền cho 1 user có quyền quản lý group : Quản lý member của group
B1 : Chuột phải lên group NhanSu Chọn
Properties Qua tab Managed By Chọn
Change
B2 : Điền user U1 vào Chọn Check name
OK
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
23
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
B3 : Tại màn hình NhanSu Properties Đánh
dấu chọn vào trước dòng Manager can update
membership list OK
B4 : Kiểm tra :
- Log on vào bằng quyền U1
- Start Administrative Tool Active Directory Users and Computers
- Mở OU Nhatnghe Chuột phải lên thư mục NhanSu Chọn Properties
- Qua tab Members Chọn Add Đưa user U1, U2 và U3 vào group Thành công
Sử dụng lệnh
# samba-tool --help
# samba-tool user --help
# samba-tool user add --help
# samba-tool user add kt4
# samba-tool user add kt5 123456
# samba-tool user add kt6 123456 --userou="ouketoan"
# wbinfo --name-to-sid kt4
S-1-5-21-877452749-2293823376-3168394136-1110 SID_USER (1)
# samba-tool group add nhansu
# wbinfo --name-to-sid nhansu
S-1-5-21-877452749-2293823376-3168394136-1111 SID_DOM_GROUP (2)
24
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
TRUNG TÂM ĐÀO TẠO MẠNG MÁY TÍNH NHẤT NGHỆ
ĐỐI TÁC ĐÀO TẠO CỦA MICROSOFT TẠI VIỆT NAM
105 Bà Huyện Thanh Quan, Q3, TP. HCM
Tel: 39.322.735 – 0913.735.906 Fax: 39.322.734 www.nhatnghe.com
HOME FOLDER - USER PROFILE
I. HOME FOLDER
1. Tạo home folder
Thêm đọan sau vào cuối file smb.conf
# vi /usr/local/samba/etc/smb.conf
[home]
path = /home/samba/home/
read only = No
Tạo thư mục
# mkdir -p /home/samba/home/
Reload lại samba
# smbcontrol all reload-config
2. Cấu hình share và filesystem permissions
Log on to a Windows machine using an account, or a member of a group, the
SeDiskOperatorPrivilege“ was granted to.
Open the Start Menu and search for Computer Management.
In the menu bar, go to Action / Connect to another computer.
Enter the ip of your Samba server you have created the new share on.
Navigate to System Tools /Shared Folders / Shares and select the newly added share.
Right-click to the share name C:\home\samba\home\ chọn Properties.
Tab Share Permissions
Change the share permissions to:
Phiên Bản Thử Nghiệm – Lưu Hành Nội Bộ
25