Topic "Remote command execution with single sign-on"

Author Message
vrkorada
[View user's profile]

Joined: 2014-02-07
Posts: 4
Hi,
I want to connect to unix hoist from my windows7 desktop and execute remote commands. I am able to do using Quest putty/ plink without typing any password using GSSAPI. However, Can I do the same using WinSCP?

Regards,
Venkat
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
WinSCP supports GSSAPI too:
http://winscp.net/eng/docs/ui_login_authentication
_________________
Martin Prikryl
vrkorada
[View user's profile]

Joined: 2014-02-07
Posts: 4
Hi,
Sorry for not clear in my question. I am looking for a .net library, so that I can use it in my application.
I couldn't find any option to use the same advanced settings to enable GSSAPI authentication.
Am I missing something? Can you share a code snippet to set the GSSAPI?

Regards,
Venkat
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Please read documentation:
http://winscp.net/eng/docs/rawsettings

If that does not help, come back.
_________________
Martin Prikryl
vrkorada
[View user's profile]

Joined: 2014-02-07
Posts: 4
Hi,
Thanks for reply. Rawsettings option is working. However, now I am getting error asking to set the hostkey.

Here is the snippet:

try
{
// Setup session options
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Scp,
HostName = "host03.company.com",
UserName = "venkat",
//Password = "mypassword",
//SshHostKeyFingerprint = "ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
};
sessionOptions.AddRawSettings("AuthGSSAPI","1");
sessionOptions.AddRawSettings("SshProt", "2");
using (Session session = new Session())
{
// Connect
session.Open(sessionOptions);
}
return 0;
}
catch (Exception e)
{
Console.WriteLine("Error: {0}", e);
return 1;
}

When I use the GUI tool WinSCP, it never asks me the host key and I never provided hostkey to plink also.
Am I missing something here?

Regards,
Venkat
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
vrkorada wrote:
When I use the GUI tool WinSCP, it never asks me the host key and I never provided hostkey to plink also.

Both WinSCP GUI and plink/PuTTY ask for host key verification on the first connect.

See also https://winscp.net/eng/docs/faq_hostkey
_________________
Martin Prikryl
vrkorada
[View user's profile]

Joined: 2014-02-07
Posts: 4
Hi,
With WinSCP UI / plink, when we connect to a host for hte first time, we get a prompt saying server's host key is not in cache and asking the confirmation to continue with caching hte key.

Is there any API for checking the availability of the key in the cache and if it not available, any API to get eh server's host key?

Regards,
Venkat
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
vrkorada wrote:
Is there any API for checking the availability of the key in the cache

No.

Quote:
and if it not available, any API to get eh server's host key?

You should not automate this. It would spoil security purpose of the verification.
Anyway, if you do not care about security, you can accept any host key with SessionOptions.GiveUpSecurityAndAcceptAnySshHostKey:
http://winscp.net/eng/docs/library_sessionoptions
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License