Инструменты пользователя

Инструменты сайта


сервис_nis

Сервис NIS

Настройка Unix сервера

!!!Для аутентификации формат карт NIS в FreeBSD и Linux не совместим

Инсталяция, инициализация БД и запуск

Ubuntu/Debian

root@server:~# apt install nis
...
Nis domain: corpX
...
root@server:~# cat /etc/defaultdomain
corpX
root@server:~# cat /etc/default/nis
...
NISSERVER=master
...
NISCLIENT=false
...
ubuntu16# /bin/systemctl add-wants multi-user.target rpcbind.service

root@server:~# init 6

root@server:~# /usr/lib/yp/ypinit -m
...
        next host to add:  server.corpX.un
        next host to add:  ^D
...
root@server:~# service ypserv restart

FreeBSD

[server:~] # cat /etc/rc.conf
...
rpcbind_enable="YES"
nisdomainname="corpX"
nis_server_enable="YES"
nis_yppasswdd_enable="YES"
[server:~] # /etc/rc.d/rpcbind start

[server:~] # /etc/rc.d/nisdomain start
Setting NIS domain: corpX.

[server:~] # mkdir /var/yp/corpX

[server:~] # service ypserv start

[server:~] # awk -F: '($3>=1000) && ($3<65533)' /etc/master.passwd > /var/yp/master.passwd

[server:~] # cd /var/yp

[server:/var/yp] # ypinit -m corpX
Server Type: MASTER Domain: corpX
...
Do you want this procedure to quit on non-fatal errors? [y/n: n]
...
Can we destroy the existing /var/yp/corpX and its contents? [y/n: n]  y
...
        master server   :  server.corpX.un
        next host to add:  ^D
...
Is this correct?  [y/n: y]
...
[server:/var/yp] # cd

[server:~] # service yppasswdd start

CentOS/SL

Настройка Windows сервера

SFU AD Windows 2003

Устанавливаем NIS server из пакета SFU

Опции инсталяции:

Custom:
        Server for NIS

Identity Management for Unix AD Windows 2008

Start->Administrative Tools->Server Manager->Roles->Active Directory Domain Services->Add Role Services->Identity Management for Unix

Identity Management for Unix AD Windows 2016

Настраиваем unix атрибуты пользователей

guser1

gidNumber: 10001

user1

uidNumber: 10001
gidNumber: 10001
unixHomeDirectory: /home/user1
loginShell: /bin/sh

group1

gidNumber: 15001
memberUid: user2
memberUid: user1

Настройка клиента

Debian/Ubuntu

# apt install nis
...
NIS domain: corpX
...
# cat /etc/defaultdomain
corpX
ubuntu16# /bin/systemctl add-wants multi-user.target rpcbind.service

ubuntu16# init 6

root@client1:~# ypcat passwd
root@client1:~# cat /etc/passwd
...
+
root@client1:~# cat /etc/shadow
...
+
root@client1:~# cat /etc/group
...
+

FreeBSD

[client1:~] # cat /etc/rc.conf
rpcbind_enable="YES"
nisdomainname="corpX"
nis_client_enable="YES"
[client1:~] # /etc/rc.d/rpcbind start

[client1:~] # /etc/rc.d/nisdomain start
Setting NIS domain: corpX.

[client1:~] # /etc/rc.d/ypbind start

[client1:~] # ypcat passwd

[client1:~] # vipw

[client1:~] # cat /etc/master.passwd
...
+:::::::::
[client1:~] # cat /etc/group
...
+:::

Проверка

# id user1

# id user2

# getent passwd
сервис_nis.txt · Последние изменения: 2019/01/25 10:46 — val