Added directory validation, creation of .ssh directory, and error messages