# Setting Up NIS, Users Can't Login



## tuaris (Dec 14, 2022)

I followed the instructions at https://docs.freebsd.org/en/books/handbook/network-servers/#network-nis to the letter and I am unable to successfully log into the system as a user:


```
Dec 14 07:40:43 cloud sshd[898]: error: PAM: Authentication error for daniel from 192.168.0.248
```

Running `ypcat passwd` shows:


```
root@cloud:~ # ypcat passwd
daniel:*:1001:1001:Daniel Morante:/home/daniel:/bin/sh
...
```

Are the instructions missing some steps?


----------



## SirDice (Dec 14, 2022)

I would suggest not bothering with NIS. It's old, it's vulnerable, it's rarely used anywhere nowadays. Pretty much everybody uses LDAP instead of NIS.


----------



## Peacekeeper2000 (Sunday at 4:37 PM)

tuaris said:


> I followed the instructions at https://docs.freebsd.org/en/books/handbook/network-servers/#network-nis to the letter and I am unable to successfully log into the system as a user:
> 
> 
> ```
> ...


This is not a NIS error in the first line. It is a PAM error. And that error is due to using PAM with sshd. So you have now a "matryoshka" with sshd->pam->nis . I am expecting that you do not have enabled NIS with pam ( e.g.  pam_unix(8) look for "nis_pass") 
Another opportunity is to disable PAM for ssh and use PKI for ssh. The challenge with that is, that yp/nis will not synchronise the home directories ( including ~/.ssh ) . nis/yp will only focus on the meta-files like user, group, hosts, ether etc. 

I also have around ten devices at home, where I love to have the same UID/GID etc. on all system. But I still not sure , if this is the effort worth to dig into an old style piece of software from ARPA net. All other softwre like LDAP/AD etc. is IMHO to shot with canons on small birds ...
But your choice


----------



## pboehmer (Monday at 4:36 PM)

Did you add the appropriate entries to master.passwd and group?  Last line in /etc/master.passwd should read something along the lines of:

```
+:::::::::
```

and /etc/group should have something like:

```
+::0:
```


----------

