Pergunta

We would like to use ssh-agent to automatically connect to many machines through ssh, using a dedicated user on a ubuntu machine (12.04); the problem is that since we have generated this user through a script

useradd -m -s /bin/bash USER

and we don't login to that user, the ssh-agent is not running and any attempt to use ssh without providing a password (we use python and paramiko) fails saying

no autentication methods available

we have done some research, and found out that many people would start ssh-agent with this command-line

eval "ssh-agent"

but this won't work for us (especially when the above command is executed through python).

The only way to make it work is to login to that user (through ssh for instance) and type the above comand, which make our automated approach not so automated: is there a way to make ssh-agent start at startup without the need to login to the dedicated user?

Foi útil?

Solução

I think this question will be better answered in the Server Fault website.

But, here is an idea.

Create an init script on all the pcs, such that when the pc starts, it logs in as the user and starts ssh-agent and logs out. Set the init script run level to start whenever the pc starts in normal/multi-user mode.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top