sprinkle a few %q's in the username/password handling to allow for difficult parameters, my case I have embedded systems which have a nil zero length) password for root in the lab, and this has to be quoted to make it work. Reference: /n/sources/patch/applied/ssh-nil-password Date: Thu Sep 20 12:16:37 CES 2012 Signed-off-by: steve@quintile.net --- /sys/src/cmd/ssh2/ssh.c Thu Sep 20 12:15:06 2012 +++ /sys/src/cmd/ssh2/ssh.c Thu Sep 20 12:15:02 2012 @@ -591,9 +591,9 @@ if (!nopka) { if (whichkey) - n = fprint(cfd1, "ssh-userauth K %s %s", user, whichkey); + n = fprint(cfd1, "ssh-userauth K %q %q", user, whichkey); else - n = fprint(cfd1, "ssh-userauth K %s", user); + n = fprint(cfd1, "ssh-userauth K %q", user); if (n >= 0) return 0; } @@ -605,13 +605,13 @@ fprint(2, "%s: didn't get password: %r\n", argv0); return -1; } - n = fprint(cfd1, "ssh-userauth k %s %s", user, up->passwd); + n = fprint(cfd1, "ssh-userauth k %q %q", user, up->passwd); if (n >= 0) return 0; path[0] = '\0'; fd2path(cfd1, path, sizeof path); - fprint(2, "%s: auth ctl msg `ssh-userauth k %s ' for %s: %r\n", + fprint(2, "%s: auth ctl msg `ssh-userauth k %q ' for %q: %r\n", argv0, user, path); return -1; }