From: John S. S. <js...@ge...> - 2008-03-20 11:07:16
|
Miklos Szeredi skrev: > > Interesting approach, it has a strongly hackish feel though. > > A better approach would be to run ssh in a pseudo terminal, and proxy > I/O to stdin/out. This makes ssh believe that it's connected to a > terminal and asks the password normally. > > I've attached a little utility that does this. If it works for you it > could be integrated into sshfs. > > Thanks, > Miklos > Doesn't work as well as the SSH_ASKPASS version: $ echo password | ./ptypipe /usr/bin/ssh root@testing date password root@testing's password: $ For testing from the shell, it works if I put echo in a loop, but that wouldn't work with pam_mount. Only tricking ssh into reading the password from stdin isn't enough in this case, because pam_mount only writes the password once. So only the first ssh connection would work. I've attached a new version of the wrapper script that works with -o reconnect. In this version the password is written to the pipe 100 times. Because of the Unix pipe buffer the writes don't block, and everything works fine. It's a good enough workaround at least. Thank you, John. |