Check for id_rsa.pub file existence

Don't just try to create a new file, check first
Also, check in the user directory, not root