doc:appunti:linux:sa:nis
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:appunti:linux:sa:nis [2020/12/16 12:00] – [Login Time Too Long in Ubuntu 18.04] niccolo | doc:appunti:linux:sa:nis [2020/12/16 16:27] (current) – niccolo | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| - | + | ||
| - | Installato il pacchetto **nis**, si è specificato come nome di dominio il dominio DNS dell' | + | |
| - | + | ||
| - | Fare attenzione al contenuto dei seguenti file: | + | |
| - | + | ||
| - | * **/ | + | |
| - | * **/ | + | |
| - | * **/ | + | |
| - | * **/ | + | |
| - | + | ||
| - | Conviene che in **''/ | + | |
| - | + | ||
| - | < | + | |
| - | 127.0.0.1 | + | |
| - | 10.0.1.47 | + | |
| - | </ | + | |
| - | + | ||
| - | Poiché vogliamo essere **NIS master server**, in '' | + | |
| - | < | + | |
| - | NISSERVER=master | + | |
| - | </ | + | |
| - | + | ||
| - | Per decidere chi ha accesso al server NIS si mette in '' | + | |
| - | + | ||
| - | < | + | |
| - | 255.255.255.0 10.0.1.0 | + | |
| - | </ | + | |
| - | + | ||
| - | **NOTA:** se il server NIS ha più di una interfaccia di rete e si vuole rispondere a richieste broadcast da parte dei client, è opportuno aggiungere in '' | + | |
| - | + | ||
| - | < | + | |
| - | # Always allow access for localhost | + | |
| - | 255.0.0.0 | + | |
| - | + | ||
| - | # Allow access from localhost (when proxying broadcast requests? | + | |
| - | # See Debian bugs: | + | |
| - | # http:// | + | |
| - | # http:// | + | |
| - | # http:// | + | |
| - | 255.255.255.255 192.168.144.2 | + | |
| - | </ | + | |
| - | + | ||
| - | infatti pare che '' | + | |
| - | + | ||
| - | < | + | |
| - | ypserv[9960]: | + | |
| - | </ | + | |
| - | + | ||
| - | Bisogna **inizializzare il database** del dominio NIS, che verrà tenuto nella directory **''/ | + | |
| - | + | ||
| - | < | + | |
| - | / | + | |
| - | </ | + | |
| - | + | ||
| - | Per testare il corretto funzionamento del server si può usare il comando '' | + | |
| - | + | ||
| - | Per modificare il nome del dominio NIS da // | + | |
| - | + | ||
| - | < | + | |
| - | / | + | |
| - | vi / | + | |
| - | rm -r / | + | |
| - | domainname newdomain.org | + | |
| - | / | + | |
| - | / | + | |
| - | </ | + | |
| - | + | ||
| - | ====== Utenti NIS separati da quelli di sistema ====== | + | |
| - | + | ||
| - | Invece di usare i file in **''/ | + | |
| - | + | ||
| - | < | + | |
| - | YPSRCDIR = / | + | |
| - | YPPWDDIR = / | + | |
| - | </ | + | |
| - | + | ||
| - | Si deve editare anche **''/ | + | |
| - | + | ||
| - | < | + | |
| - | YPPWDDIR=/ | + | |
| - | </ | + | |
| - | + | ||
| - | Per fare in modo che **ypinit** riesca a generare i database necessari bisogna creare i seguenti file nella directory **/ | + | |
| - | + | ||
| - | ^ group | Inizialmente vuoto. | + | |
| - | ^ hosts | Contiene almeno una riga per 127.0.0.1 localhost. | + | |
| - | ^ netgroup | + | |
| - | ^ passwd | + | |
| - | ^ protocols | + | |
| - | ^ rpc | Copiato da ''/ | + | |
| - | ^ services | + | |
| - | ^ shadow | + | |
| - | + | ||
| - | Dopo aver modificato il contenuto di tali file bisogno aggiornare lo stato del server NIS: | + | |
| - | + | ||
| - | < | + | |
| - | make -C /var/yp | + | |
| - | </ | + | |
| - | + | ||
| - | Per far partecipare gli utenti NIS a gruppi di sistema (ad esempio plugdev, lpadmin, ecc. di Ubuntu) bisogna aggiungere le voci opportune in **''/ | + | |
| - | ====== NIS client ====== | + | |
| - | + | ||
| - | Si installa il pacchetto **nis**. Chiunque voglia essere NIS client (eventualmente anche il NIS server stesso) deve impostare **'' | + | |
| - | + | ||
| - | ===== Name Service | + | |
| - | + | ||
| - | La **GNU C Library** fornisce i servizi ad esempio per avere l' | + | |
| - | + | ||
| - | === Integrazione in modalità " | + | |
| - | + | ||
| - | Per integrare gli utenti e i gruppi NIS in quelli standard unix si devono modificare i file **''/ | + | |
| - | + | ||
| - | < | + | |
| - | < | + | |
| - | < | + | |
| - | + | ||
| - | Verificare nel file **/ | + | |
| - | + | ||
| - | === Integrazione in modalità " | + | |
| - | + | ||
| - | In alternativa si può indicare in **/ | + | |
| - | + | ||
| - | < | + | |
| - | passwd: | + | |
| - | group: | + | |
| - | shadow: | + | |
| - | </ | + | |
| - | + | ||
| - | :!: **ATTENZIONE**: | + | |
| - | + | ||
| - | ===== Ricerca del server NIS ===== | + | |
| - | + | ||
| - | La ricerca del NIS server avviene tramite richieste broadcast sulla rete locale. Per evitarle (potrebbero fallire per regole di firewall) si dichiarano esplicitamente i server in **''/ | + | |
| - | + | ||
| - | < | + | |
| - | # We states NIS servers explicitly to avoid broadcast requests. | + | |
| - | ypserver bianca.rigacci.org | + | |
| - | ypserver neve.rigacci.org | + | |
| - | </ | + | |
| - | + | ||
| - | Un altro motivo per cui la **richiesta broadcast potrebbe fallire** è se il server NIS è **multihomed** (ha più di una interfaccia di rete), vedi la nota sopra riguardo '' | + | |
| - | + | ||
| - | L' | + | |
| - | ====== NIS slave server ====== | + | |
| - | + | ||
| - | Configurare l'host che dovrà essere **slave server** come se fosse un NIS client, quindi mettere in **''/ | + | |
| - | + | ||
| - | Sul **master** modificare **''/ | + | |
| - | + | ||
| - | Riavviare NIS sullo slave ed eseguire **''/ | + | |
| - | + | ||
| - | Le repliche dovrebbero avvenire automaticamente dal master allo slave. Nel caso qualcosa vada storto è opportuno configurare un **cron job** sullo **slave** come suggerito dal file nis.debian.howto: | + | |
| - | + | ||
| - | < | + | |
| - | 20 * * * * root / | + | |
| - | 40 6 * * * root / | + | |
| - | 55 6,18 * * * root / | + | |
| - | </ | + | |
| - | + | ||
| - | ====== Firewall ====== | + | |
| - | + | ||
| - | Se il server NIS è protetto da firewall che filtra in base al numero di porta si deve avere l' | + | |
| - | + | ||
| - | In particolare si devono indicare le porte per **ypserv**, **yppasswdd**, | + | |
| - | + | ||
| - | In un sistema Debian vedere **''/ | + | |
| - | + | ||
| - | < | + | |
| - | YPSERVARGS=" | + | |
| - | YPPASSWDDARGS=" | + | |
| - | </ | + | |
| - | + | ||
| - | ====== Directory home su NFS ====== | + | |
| - | + | ||
| - | Attenzione al percorso delle home directory, se si sceglie qualcosa di diverso da **''/ | + | |
| - | + | ||
| - | Il rischio è di incappare in errori " | + | |
| - | + | ||
| - | Ad esempio se le home directory sono state montate su **''/ | + | |
| - | + | ||
| - | < | + | |
| - | (evince: | + | |
| - | `/ | + | |
| - | but the parser failed: Failed to open file '/ | + | |
| - | </ | + | |
| - | + | ||
| - | contestualmente il kernel logga: | + | |
| - | + | ||
| - | < | + | |
| - | Jan 9 11:35:02 nisclient kernel: [ 5422.898561] type=1400 audit(1357727702.213: | + | |
| - | apparmor=" | + | |
| - | name="/ | + | |
| - | requested_mask=" | + | |
| - | </ | + | |
| - | + | ||
| - | In questo caso è sufficiente modificare il file **''/ | + | |
| - | + | ||
| - | < | + | |
| - | @{HOMEDIRS}=/ | + | |
| - | </ | + | |
| - | + | ||
| - | ====== Login Time Too Long in Ubuntu 18.04 ====== | + | |
| - | + | ||
| - | After installing an **Ubuntu 18.04 as a NIS client** with home directories mounted over NFS, we noticed very long times required to complete the login. Even on the tty1 console, there was a **wait time of about 25 seconds** after typing the passowrd, before to get the command line prompt. | + | |
| - | + | ||
| - | The only apparent error message found in the **syslog** was: | + | |
| - | + | ||
| - | < | + | |
| - | systemd-logind[2133]: | + | |
| - | </ | + | |
| - | + | ||
| - | A nice solution was to **install the nscd package**. The complete story was a bit more complicated, | + | |
| - | + | ||
| - | * **[[https:// | + | |
| - | * **[[https:// | + | |
| - | + | ||
| - | One user pointed out that the bug affects also what is reported in **/ | + | |
| - | + | ||
| - | < | + | |
| - | IPAddressDeny=any | + | |
| - | </ | + | |
| - | + | ||
| - | ====== NIS users unable to poweroff/ | + | |
| - | + | ||
| - | We experienced a problem with an **Ubuntu 20.04** Focal Fossa used as **NIS client**: some tasks were inhibited because the user - despite it was **logged-in locally** on the physical machine - it was considered **as a remote** one. | + | |
| + | Pages relate to **[[wp> | ||
| + | * **[[nis_server]]** | ||
| + | * **[[nis_user_shutdown_problem]]** | ||
doc/appunti/linux/sa/nis.1608116445.txt.gz · Last modified: by niccolo
