Centralized Logins Using NIS

Configuring The NIS Server

Install the NIS Server Packages:  # yum install ypserv

Edit Your /etc/sysconfig/network File

Edit Your /etc/yp.conf File

Start The Key NIS Server Related Daemons

Check service running correctly

Initialize Your NIS Domain

Make sure portmap is running before trying this step

Start The ypbind and ypxfrd Daemons

Again Check service running correctly

Adding New NIS Users

Build NIS User into /var/yp directory

Kiểm tra nisuser có tồn tại trên NIS server chưa?

Configuring The NIS Client

Configuring The NFS Client (automount /home)

Cần các gói dịch vụ sau: netfs, nfslock (optional), and rpcbind daemons are running. Việc thiết lập NFS server xem hướng dẫn tại đây.

# chkconfig nfslock on

Cần phải cài đặt thêm gói autofs nếu chưa có.

Edit your /etc/auto.master file với line sau :

Edit file /etc/auto.home

Đảm bảo autofs running

Connect to NIS server

Sử dụng console mode : lưa chọn phương thức NIS , nhập các thông số domain name, server name …

Hoặc config trực tiếp trong các file sau :

Cần bổ sung thêm gói ypbind để kêt nói tới yp server (NIS server):

Verify Name Resolution

Test NIS Access To The NIS Server

You can run the ypcat, ypmatch, and getent commands to make sure communication to the server is correct.

list ra các user trên NIS server

hoặc match trực tiếp 1 nisuser

Chú ý: các bước thực hiện trên được thực hiện trên Centos (Server) và Fedora (client). Các bước này có thể thực hiện trên các Distro khác với 1 số thay đổi nhỏ.

Chú ý : việc remote authentication (thông qua LDAP, NIS,… ) có thể conflict với local : nghĩa là user id trên local trùng với user id trên Server . Để xử lý case này phải thay đổi uid hoặc xoá local user .

In /etc/passwd I change the line to look like this “howard:x:1024:1009:Howard ……
In /etc/group I change the line to look like this “howard:x:1009:”

hoặc sử dụng lệnh usermod và groupmod để reset lại uid và gid cho user.

Hoặc muốn authentication theo thứ tự thì cần config trong file /etc/nsswitch.conf

ví dụ : dưới sẽ theo thứ tự files > nis > ldap

Leave a Reply

Your email address will not be published.