Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

There are two unix accounts A and B. I want to configure password less ssh between these two accounts.This can be done without much pain but my problem is that there are mutiple accounts like A and B where I have to the same thing.I also have one admin account C (not root). So,I was thinking if it is possible to setup password less ssh connection between A and B from account C so that I can write a script and run it from account C every time I want do similar activity for different accounts.

(Also ,all the accounts have the same password .)

share|improve this question

1 Answer 1

You need to, as user C, execute sudo -u A ssh-keygen this will result in two files being created id_rsa and id_rsa.pub in ~A/.ssh. You would then execute, as user C, ssh B@remote-host 'cat >> ~B/.ssh/authorized_keys' < ~A/.ssh/id_rsa.pub. Of course ~A/.ssh/id_rsa.pub needs to be readable by user C.

share|improve this answer

Your Answer

 
discard

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.