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?
Asked
Active
Viewed 114 times
0
Hữu Linh Nguyễn
- 45
- 1
- 3
1 Answers
1
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.
Janka
- 1,736
- 9
- 11