adding checks around ssh key file creation