Sure, for things that can use ssh keys it works great. This is how I connect to various git servers.
But in the case of this hack the services that were compromised were Amazon, Gmail, and iCloud web pages. All things that authenticate with user/password and not SSH keys.