This project is read-only.

SSH.net server string is null by sftp.connect()

Feb 4, 2014 at 12:31 PM
Hi,

First of all I want to say that so far I have no experience with the ssh.net Framework.
I want to connect to the server but the following problem (server string is null at line sftp.Connect();) occured and I'm not able to solve it.
Maybe someone can tell me what it could be or what i should check.

Thanks in advance
using (var sftp = new SftpClient("127.0.0.1", 990, "admin", "admin"))
                {

                    string wd=sftp.WorkingDirectory;
                    string ci = sftp.ConnectionInfo.ToString();
    

                   if(!sftp.IsConnected)
                    sftp.Connect();

                    string uploadedFileName = @"C:\Users\gat\Desktop\test\MyFile.txt";
                    string remoteFileName = "test2.txt";

              
                    using (var file = File.OpenRead(uploadedFileName))
                    {
                        sftp.UploadFile(file, remoteFileName);
                    }

                    sftp.Disconnect();
                }
}
Feb 4, 2014 at 12:44 PM
Port 990 is FTPS not SFTP.

SFTP => FTP over SSH
FTPS => FTP with SSL/TLS

FTPS is not supported by this library, since it has nothing to do with SSH.