Prakhar Verma
Prakhar Verma

Reputation: 11

SharpSSH: The requested name is valid, but no data of the requested type was found

I'm trying to connect to SFTP server using SharpSSH, and getting exception -

Tamir.SharpSsh.jsch.JSchException: System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was found

My code looks like this:

Sftp sftp = null;
sftp = new Sftp("ftp://XX.XXX.XX.XX/", "UserName", "Password");
sftp.Connect();

Am I writing server address in wrong format?
What can be the other reason? If DNS issues.. then what are those and how to resolve them?

Upvotes: 1

Views: 846

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202504

  1. Do not use SharpSSH, it's a dead project. Use some SFTP library that is maintained. See SFTP Libraries for .NET.
  2. The first argument to the Sftp class is called sftpHost, so you cannot pass a URL, you have to pass a host name, i.e. only the XX.XXX.XX.XX.
  3. SharpSSH is SFTP/SSH library, not FTP. If you really need to connect to FTP, you cannot use SharpSSH.
  4. The IIS indeed does not support the SFTP. It supports only the FTP (and the FTPS = FTP over TLS/SSL). See Is IIS SFTP natively supported by Windows?
    For the FTPS/FTPS, use the FtpWebRequest from the .NET framework.

Upvotes: 1

Related Questions