Ssh authentication from .NET webpage to UNIX is not working

My .NET website invokes a perl script to perform GIT operations on Gerrit server running UBuntu. In the perl script I connect using passwordless authentication to Gerrit server as below:

system ( "ssh gitadmin@gerritserver.com 'cd /xyz && git clone xxx' ");

I verified that ssh authentication is set up correctly between windows client and Unix server. This script works well from windows command prompt but when run from the context of website the page hangs at the ssh command execution.

I have ensured that the user account the website and application pool are running under is the same as the user account ssh authentication is set-up for. Any idea why ssh is unable to authenticate from the website? It looks like the permissions on the ssh process in the context of IIS are not the same as outside it.

As an alternative I have been looking into password-specific authentication using ssh and host-based authentication. Is host-based authentcation possible between windows client and unix server?

Is the user id running ssh the same in both cases?

Try it this way and post the restults:

system( "ssh -vvv gitadmin@gerritserver.com 'cd /xyz && git clone xxx' ");

Yes, verbose is great for debugging problems in ssh.

1 Like