Ssh – Passwordless ssh with NFS+NIS

nfsnisssh

I'm playing around with a cluster (with torque+open-mpi). I have a master node and compute nodes. Master submit jobs to computes nodes. To do it I use NIS+NFS in order to unify UID's and home directory. In order to execute remote commands I use ssh and keychain to get passwordless login.

Everything seems OK, doesn't it? Well not really.

For example let's say master is master node and node1 and node2 are compute nodes. So when Issue a job, node1 and node2 ask for the passphrase. Ensuing remote commands does not ask for passphrase anymore. Are you thinking all is OK? Not really 🙂

Let's say that I add 30 new nodes. I will have to enter the passphrase for the first time for every node, which is somewhat insane. Or let's say that I have to reboot some of the nodes, the same problem…

I've tried with openssh certificates (ssh-keygen -s …) but it's the same issue, I depend on ssh-agent. Perhaps what I'm looking for it's somewhat insecure, but I'd want that every compute node use the socket of master node. but I have no idea how to do it.

It seems that is not possible ssh via public key authentication for users administered with NIS , doesn't it?

Any idea? Thanks in advance

Best Answer

ssh-agent and some method of distributing the public key (authorized_keys in the users home directory, mounted over NFS works) is the standard answer to your request.

For bonus points you can consider using agent forwarding to pass your credentials along if you need to pass through more than one node for some reason..

As you've given no reason why this wouldn't work in your situation, I recommend that you implement this solution.