I using for i in <ip1> <ip2> ... <ipn>; do ssh pi@$ip sudo halt; done to turn off multiple raspberry pi. But i don't want iput password one by one for a lot of raspberry pi. So what should I do that?


This question is not Raspberry-specific.

Read up ssh key-based authentication as put e.g. here

As soon you have the shared key created and copied it onto the target hosts (simplest method: use ssh-copy-id), you can start an ssh agent on the coordinating host (e.g. in its .profile or .xinitrc) and only need to type the key password once per session with ssh-add.

Or use passwordless keys.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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