Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm experimenting with using NIS for centralizing the user management for a network of approx 20 servers.

I've got an NIS client and server working, and can ssh to the client machine and successfully log in, but only using a password. I'd like to be able to use public key authentication - how might I do this?

share|improve this question
What does PubkeyAuthentication say in your sshd_config (default being yes)? Home directories being mounted properly? ~/.ssh/authorized_keys? – andol Aug 17 '10 at 10:57
public key auth worked on client machine prior to making that machine use NIS. Your second point probably illustrates where I'm going wrong, as I'm not using NFS. I was hoping there was some way the SSH daemon could obtain authorized_keys over NIS? – Paul Dixon Aug 17 '10 at 11:25
up vote 2 down vote accepted

Sorry, AFAIK you can't distribute ssh keys over NIS - they live in ~/.ssh/authorized_keys. So NFS-mounted homedirs would do it. Or you could set up replication (presumably of just .ssh directories or others you choose) using something like unison.

share|improve this answer

You can do it by mounting /home via NFS and setsebool use_nfs_home_dirs 1

share|improve this answer
This really works and is slick solution. Should be the accepted answer because it actually addresses the issue, rather than suggesting something else. – craigdfrench Dec 12 '15 at 1:23

I think maybe NIS isn't best suited to my needs, am looking at Puppet as an alternative way of providing centralized user administration.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.