8/1/12

CẤU HÌNH NIS CLIENT


1.1.1.     CẤU HÌNH NIS CLIENT

-   Chỉnh sửa file /etc/yp.conf
domain      serverlinux.vn          broadcast
-   Start tiến trình ypbin:

-   Sử dụng lệnh ypwhich để kiểm tra NIS server nào đang phục vụ những request NIS:

-   Lệnh ypcat để liệt kê thông tin một bảng map trên NIS server:

-   Cấu hình file /etc/nsswitch.conf để hệ thống cần tìm kiếm thông tin:

-   Dùng một máy khác login bằng user chỉ có trên NIS server (không tồn tại ở máy cục bộ) để kiểm tra hoạt động sử dụng NIS chứng thực:

-   Khi thay đổi thông tin trên bảng map của NIS server, như thêm user test vào file /etc/passwd

-   Update lại thông tin trên NIS server như sau:

-   Tại NIS client, xem lại bản map:

-   Xóa thông tin của user test trên local:#userdel         test

-   Thử switch qua user test, kết quả vẫn switch được bình thường, vì lúc này thông tin đã được tìm kiếm trên NIS

[root@linux ~]#yum -y install ypbind rpcbind
[root@linux ~]#vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=www.serverlinux.vn
# add at the last line
NISDOMAIN=serverlinux.vn
[root@linux ~]#vi /etc/sysconfig/authconfig
USENIS=yes              # line 19: change
[root@linux ~]#vi /etc/yp.conf
# add at the last line ( [domain] server [NIS server] )
domain serverlinux server dlp.serverlinux
[root@linux ~]#vi /etc/nsswitch.conf
passwd:     files       nis   # line 33: add
shadow:     files       nis   # add
group:            files       nis   # add
hosts:            files dns nis     # add
# add optionally if you need ( create home directory automatically if it's none )
[root@linux ~]#vi /etc/pam.d/system-auth
# add at the last line
session     optional      pam_mkhomedir.so skel=/etc/skel umask=077
[root@linux ~]#chkconfig rpcbind on
[root@linux ~]#chkconfig ypbind on
[root@linux ~]#shutdown -r now
www.serverlinux login:debian  # user on NIS
Password:         # password
Creating directory '/home/debian'.
[debian@www ~]$# logined
[debian@www ~]$ypwhich
dlp
[debian@www ~]$ypcat passwd
cent:x:500:500::/home/fermi:/bin/bash
ubuntu:x:502:502::/home/ubuntu:/bin/bash
fedora:x:501:501::/home/cent:/bin/bash
debian:x:503:503::/home/debian:/bin/bash
[debian@www ~]$ypcat hosts
10.0.0.30 dlp dlp.serverlinux
10.0.0.30 dlp dlp.serverlinux
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
[debian@www ~]$yppasswd       # try to chnage NIS password
Changing NIS account information for debian on dlp.
Please enter old password:          # current one
Changing NIS password for debian on dlp.
Please enter new password:          # new one
Please retype new password:
The NIS password has been changed on dlp.
[debian@www ~]$               #just changed

Bài đăng phổ biến