Is there a way to log into a server without using passwords coded into the 
script?

I'm trying to retrieve files from a server for every computer I have based on 
the serial number of the machine.

This is what I have so far. (I'm very new to bash. Any advice would be helpful)


#!/bin/sh

myserial=ioreg -l |grep IOPlatformSerial|cut -d "\"" -f 4

copyPath=~/pathhere
destinationPath=/pathhere
copyPath2=~/pathhere
destinationPath2=/pathhere

<NEED LIGIN/PASSWORD ADVICE HERE>

scp user@host:$copyPath/$myserial.pem $destinationPath/
scp user@host:$copyPath2/$myserial.pem $destinationPath2/

exit 0

Reply via email to