So you want to ssh to each machine and make that change? Should be pretty straightfoward with ssh and expect. Check out this stackoverflow question about that approach. Basically you just need to use expect to automate the ssh logins and then run something like this on every server (all via expect):
find /home/ -type f -maxdepth 1 -print0 | xargs -0 sed -i 's/pub-xxxxxxx/pub-12345/'
that will use sed to edit every file in-place in /home (and no lower in the tree) and replace occurrences of the first string with the latter.
If this is more than a one-time thing you can look into automating this more cleanly, like setting up passwordless ssh logins to eliminate the expect step. However if I understand your question correctly you are really looking for a one-time solution, which is why I say use expect this way.