My .NET website invokes a perl script to perform GIT operations on Gerrit server running UBuntu Linux. In the perl script I connect using passwordless authentication to Gerrit server as below:
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. Any idea what is wrong?
As an alternative I have been looking into password-specific authentication using ssh and host-based authentication. Is host-based authentication possible between windows client and unix server?
You might and again this could be a long shot but you might be able to make use of Process.Start("C:\\program\\perl.exe yoruscript.pl") in your code behind to run this script. Since this script would run on the server, you might have some luck. Hope this
helps :)
Mark as answer posts that helped you.
Marked as answer by Amy Peng - MSFT on Nov 15, 2012 12:15 AM
tjkota
0 Points
1 Post
Ssh authentication from .NET webpage to UNIX is not working
Nov 07, 2012 08:47 PM|LINK
My .NET website invokes a perl script to perform GIT operations on Gerrit server running UBuntu Linux. 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. Any idea what is wrong?
As an alternative I have been looking into password-specific authentication using ssh and host-based authentication. Is host-based authentication possible between windows client and unix server?
bbcompent1
All-Star
33097 Points
8529 Posts
Moderator
Re: Ssh authentication from .NET webpage to UNIX is not working
Nov 09, 2012 06:04 PM|LINK
You might and again this could be a long shot but you might be able to make use of Process.Start("C:\\program\\perl.exe yoruscript.pl") in your code behind to run this script. Since this script would run on the server, you might have some luck. Hope this helps :)