I was unable to switch users, executing as root seemed to do the trick.
`ssh -i $KEY $USER@$HOST "echo "$DATA" |sudo tee $DIRECTORY"`
I was unable to switch users, executing as root seemed to do the trick.
`ssh -i $KEY $USER@$HOST "echo "$DATA" |sudo tee $DIRECTORY"`