J0RDIE97 wrote:Investigate the use of public/private key pairs for ssh authentication. By using an agent on the 'remote' [non-RPi] device to provide the private part of the key-pair, login can be made to look 'automatic', while still being secure.
Do you know of a good tutorial to go through this process? Much appreciated!
If you've created a key with the ssh-keygen command, you can just copy that key to the machine you want to be able to access without a password using the ssh-copy-id command, e.g.:
ssh-copy-id wally@jimmy
Your ssh configuration information for each account is normally stored in ~/.ssh which won't exist until you've run the ssh-keygen command. Investigate the file ~/.ssh/config which can be used to store details for the account's ssh use including for each command. For example:
Host bobby.ssh
HostName wally
user jimmy
Then you can run your script with
ssh bobby.ssh
and it will automatically log in. The advantage of this over just typing ssh jimmy@wally is that you can have a lot more configuration details than I had above including sharing ssh connections so you can go in and out of programs that connect ssh without the overhead of authenticating each time.