Code Monkey home page Code Monkey logo

libssh2_delphi's Introduction

Delphi/Pascal Wrapper around the library "libssh2"

Sample Sample

libssh2_delphi's People

Contributors

fschetterer avatar nilsgaertner avatar pult avatar rburgstaler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libssh2_delphi's Issues

Fingerprints and hashes

I'm just checking out the code and noticed that there is the interface iHashManager for fingerprint checks, but I could not find any implementation.
Are you aware of an implementation for the hash manager?

SHA256 is also missing as a hash type. This has been implemented in lbssh2 but did not find its way into the delphi incarnation.

Incompatible types: 'Dynamic array' and 'Pointer'

In module: uMySFTPClient.pas
Line:StoredFingerprint := FHashMgr.GetFingerprint(FHost, FPort);
Error:
[dcc32 Error] uMySFTPClient.pas(1103): E2010 Incompatible types: 'Dynamic array' and 'Pointer'

Delphi 10.2 Berlin.

SSH Tunnel

Is it possible to create an SSH tunnel, that is, pass parameters when connecting to the server?
For example, via the command line I can map a local port pointing to the server:

ssh -L 5454:localhost:5454 -L 6379:localhost:6379 user@host

in this example, I am mapping my local ports, to ports on the linux server
Thanks

Does it support Socks5 proxy?

Thanks to the original author and @pult for improving this library!

Does the SFTP component support connecting through Socks5 proxy? If yes, how?

Thank you!

Authentication method "None" not supported

uMySftpClient exits with "Could not get user auth list.", when the ssh server supports authentication method NONE.
According to libssh2_userauth_list, a server accepting NONE as authentication returns nil. Therefore, we need to check libssh2_userauth_authenticated(FSession) after the call to libssh2_userauth_list.

Suggested change in line 1125:

    UserAuthList := libssh2_userauth_list(FSession, PAnsiChar(AnsiString(FUserName)), Length(AnsiString(FUserName)));
    if (libssh2_userauth_authenticated(FSession) = 0) then
    begin
      if UserAuthList = nil then
      begin
        Disconnect;
        RaiseSSHError('Could not get user auth list.');
      end;

    auth:

      AuthOK := False;
      AuthMode := ParseAuthList(UserAuthList);
      if amTryAll in AuthMode then
        AuthOK := UserAuthTryAll
      else
      begin
        if amPassword in AuthMode then
          AuthOK := UserAuthPassword;
        if not AuthOK and (amKeyboardInteractive in AuthMode) then
          AuthOK := UserAuthKeyboardInteractive;
        if not AuthOK and (amPublicKey in AuthMode) then
          AuthOK := UserAuthPKey;
        if not AuthOK and (amPublicKeyViaAgent in AuthMode) then
          AuthOK := UserAuthPKeyViaAgent;
      end;

      if not (AuthOK and (libssh2_userauth_authenticated(FSession) > 0)) then
      begin
        B := True;
        if Assigned(FOnAuthFail) then
          FOnAuthFail(Self, B);
        if not B then
        begin
          Disconnect;
          Exit;
        end
        else
          goto auth;
      end;
    end;

A non-blocking socket operation could not be completed immediately

Hi,

I encounter a problem when I send some files.

During the Put command, after some seconds,
the error "A non-blocking socket operation could not be completed immediately" appears.
(In french : "Une opération non bloquante sur un socket n’a pas pu être achevée immédiatement")

Error message

I performed the test on 2 SFTP servers with the same result.

Interesting thing, the problem does not occur if the file is small enough (<6MB on the first server, <40MB on the second).
Other precisions :

  • the connection with these servers is not very fast (~100ko/s)
  • I have test this with the client demo include in the sources

Have you ever encountered this problem?

Sorry, but why len=(Length(sth) - 1)

why in libssh2.pas length = length (string)-1. I had to remove "1"
For Example
libssh2_channel_open_ex(session, SSession, Length(SSession) - 1, ...); libssh2_channel_process_startup(channel, 'shell', Length('shell') - 1, nil, 0);

Could not load library "libssh2.dll"

Delphi 10.2
When executing the demo, the following error appears:

First chance exception at $744908B2. Exception class ELoadLibrary with message 'Could not load library "libssh2.dll"'. Process Project1.exe (15488)

Module not found in Library libssh2.dll; Function libssh2_exit

When I call TSFTPClient.Create, an exception is thrown in the constructor of TSSH2Client at:
if InterlockedIncrement(GSSH2Init) = 1 then
The error is:

Module not found
Library: libssh2.dll
Function: libssh2_exit

I'm using the libssh2.dll from the bin directory (Version from 2016-11-02).
Also, the 32bit example Project1_d11.exe throws an error "Could not find the library: "libssh2.dll" (%1 is not a valid Win32 application).

Envio de arquivos textos acima de 64kb

Ola,

Estou com problema de envio de arquivos usando o comando PSFTP.UploadStream, ele so aceita arquivos textos com mesmo de 64kb, como podemos solucionar esta situação ?

  UploadStream := TFileStream.Create(APath, fmOpenRead);
  PSFTP.UploadStream(System.UTF8Encode(lArquivo), UploadStream, False);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.