Tag: FEH

sshpass, scp and feh. Sending files over ssh without prompting for a password

I got a Raspberry Pi as a webcam/timelapse setup. I thought it would be fun to also send it to my other Pi so it would show up on my desktop.

This how I did it.

First I needed to send the file from the PiCam to the PiDesktop and I use SSH and SCP. The thing is, with SCP you need to enter a password and because we run it in on a cronjob we have a problem.

This is how you can get arround that. Use SSHPASS.

First we need to install sshpass:

Then you can use it like this:

Yeah its not secure. Follow the links to read more about a better approach.

As it arrives on the PiDesktop, FEH will pick it up and sends it to a nice picture windows.

Sources:
https://www.tecmint.com/sshpass-non-interactive-ssh-login-shell-script-ssh-password/
https://linux.die.net/man/1/feh
https://www.linux.com/learn/cool-linux-command-line-image-management-hacks

This is a better way to connect with SCP and a password:
https://kb.iu.edu/d/aews and https://alvinalexander.com/linux-unix/how-use-scp-without-password-backups-copy