after writing to sdcard, try to fix the configuration /<mount point sdcard>/etc/ssh/sshd_config and change the parameter
#PermitRootLogin prohibit-password
PermitRootLogin prohibit-password
and
#PasswordAuthentication yes
PasswordAuthentication yes
#PermitRootLogin prohibit-password
PermitRootLogin prohibit-password
and
#PasswordAuthentication yes
PasswordAuthentication yes