Linux Views 4

Uploading files with an SSH PEM key

BASH
FILE=`cat ip.list`
for IP in $FILE
do 
	scp -i key.pem -o "StrictHostKeyChecking=no" -r ./file admin@$IP:/home/admin
	ssh -i key.pem -o "StrictHostKeyChecking=no" admin@$IP chmod 755 ./file
	scp -i key.pem -o "StrictHostKeyChecking=no" -r ./config/config.conf admin@$IP:/home/admin
	ssh -i key.pem -o "StrictHostKeyChecking=no" admin@$IP "mkdir config; mv config.conf ./config"

done

Reactions

Comments 0

A nickname and a password are required. The same password edits or deletes the comment later. Comments appear after a review.

Comments appear after a review. The password is used again to edit or delete.