Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-08

Synapse SSH

13 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Antonio Fortuny

Hi Folks.

Having seen Synapse as a lightweight TCP component I have made a little test.
Download the latest Synapse sources from
http://synapse.ararat.cz/doku.php/download, unzip and make a basic component.
Then I downloaded the cryptlib (3.4.2) from
http://www.cryptlib.com/security-software/download-form and moved the cl32.dll to output dir and the binding pascal source to my project dir. Except some errors for unpaired braces, it complies OK But when launched I get the error "10091 Invalid PAM autentication request packet" almost immediately
The server I try to connect to using SSH can be reached by putty under the same autentication pair (login/password).

Any ideas ?

Thanks.

Antonio.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130802/0c28e027/attachment.html>

Reply by email

Reinier Olislagers
to Antonio Fortuny
Antonio Fortuny wrote 5 lines
Having seen Synapse as a lightweight TCP component I have made a little test. Download the latest Synapse sources from http://synapse.ararat.cz/doku.php/download, unzip and make a basic component.

Are you sure those are the latest sources? AFAIK, they're in a subversion repository.

Show quoted text 6 lines
Then I downloaded the cryptlib (3.4.2) from http://www.cryptlib.com/security-software/download-form and moved the cl32.dll to output dir and the binding pascal source to my project dir. Except some errors for unpaired braces, it complies OK But when launched I get the error "10091 Invalid PAM autentication request packet" almost immediately

Synapse+SSH with the given crypto libs does not easily support certificate-based login.
A working example can be found here:
http://wiki.lazarus.freepascal.org/synapse
I ran the libssh2 example with certificates succesfully. You could try first if that works for you...

Reply by email

Antonio Fortuny
to Reinier Olislagers

Le 02/08/2013 16:16, Reinier Olislagers a ?crit :

Show quoted text 8 lines
On 02/08/2013 15:48, Antonio Fortuny wrote: > Having seen Synapse as a lightweight TCP component I have made a little > test. > Download the latest Synapse sources from > http://synapse.ararat.cz/doku.php/download, unzip and make a basic > component. Are you sure those are the latest sources? AFAIK, they're in a subversion repository.

It is a stable release *2012-04-23 - release no. 40* as they**write onto the main site*
*

Show quoted text 11 lines
> Then I downloaded the cryptlib (3.4.2) from > http://www.cryptlib.com/security-software/download-form and moved the > cl32.dll to output dir and the binding pascal source to my project dir. > Except some errors for unpaired braces, it complies OK > But when launched I get the error "10091 Invalid PAM autentication > request packet" almost immediately Synapse+SSH with the given crypto libs does not easily support certificate-based login. A working example can be found here: http://wiki.lazarus.freepascal.org/synapse

Done. Copied the basic object and app code into my one and get the same answer when connecting. Encryption key is empty but password is not.

Show quoted text 8 lines
I ran the libssh2 example with certificates succesfully. You could try first if that works for you... -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Sita Software *Antonio Fortuny* Senior Software engineer 220, avenue de la Libert? L-4602 Niederkorn Tel.: +352 58 00 93 - 93 www.sitasoftware.lu <http://www.sitasoftware.lu> Your IT Partner -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130802/80b359de/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: hjgafhjd.jpg Type: image/jpeg Size: 2306 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130802/80b359de/attachment.jpg> -------------- next part -------------- A non-text attachment was scrubbed... Name: egghdihg.jpg Type: image/jpeg Size: 921 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130802/80b359de/attachment-0001.jpg>

Reply by email

waldo kitty
to Antonio Fortuny: Hi Folks. Having seen Synapse as a lightweight TCP component I have made a little test.…
Antonio Fortuny wrote
But when launched I get the error "10091 Invalid PAM autentication request packet" almost immediately The server I try to connect to using SSH can be reached by putty under the same autentication pair (login/password).

are you trying to use ssh name/password login format or ssh certificate login format? there's probably an option.setting you need to set in your code for the object you are using to disable certificate logins and fall back to or enable name/password logins...

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Antonio Fortuny
to Antonio Fortuny: Hi Folks. Having seen Synapse as a lightweight TCP component I have made a little test.…

I've copied the example from the wiki as a second test. I only set the pair login/password: same result as before (PAM autentication failed).
Then I generated a pair of SSH2-rsa keys (1024) using puttygen and assigned the PrivateKey property to the private key file generated. Result is worse as an exception arises without explanation. One thing is at least sure: the plain socket connects well to the server so we can forget about netwoprk failures.
On the other hand, I can connect to the server:22 with putty from win32 and from ssh from any other Linux box
I began to trace but I'll leave it for next monday.

Have a nice WE.

Antonio.

Reply by email

Reinier Olislagers
to Antonio Fortuny
Antonio Fortuny wrote 6 lines
I've copied the example from the wiki as a second test. I only set the pair login/password: same result as before (PAM autentication failed). Then I generated a pair of SSH2-rsa keys (1024) using puttygen and assigned the PrivateKey property to the private key file generated. Result is worse as an exception arises without explanation.

Read the wiki article. It should explain how to generate keys. The format is not what you'd expect.

Have a nice WE.

You too!

Reply by email

Antonio Fortuny
to Reinier Olislagers

Le 02/08/2013 17:22, Reinier Olislagers a ?crit :

Show quoted text 9 lines
On 02/08/2013 17:02, Antonio Fortuny wrote: > I've copied the example from the wiki as a second test. > I only set the pair login/password: same result as before (PAM > autentication failed). > Then I generated a pair of SSH2-rsa keys (1024) using puttygen and > assigned the PrivateKey property to the private key file generated. > Result is worse as an exception arises without explanation. Read the wiki article. It should explain how to generate keys. The format is not what you'd expect.

Hi Reinier.

I have had a complete read of http://wiki.lazarus.freepascal.org/Synapse. Maybe because it is monday morning, I haven't read any reference to how to generate keys for SSH connection
Based upon the full exemple listed in the page, I've set up a simple front-end program.
It's major code if the next snippet:

var
   FClientSSh: TTelnetSSHClient;
   FClientSSh := TTelnetSSHClient.Create;
   FClientSSh.UserName := ELogin.Text;
   FClientSSh.Password := EPassword.Text;
   FClientSSh.HostName := EServerIP.Text;
   FClientSSh.Port := '22';
   FClientSSh.ProtocolType := SSH;
   FClientSSh.PrivateKeyFile := EmptyStr;
   FClientSSh.Servertype := Unix;
   wLastErrorText := FClientSSh.Connect;

exception: PAM autentication failed.

Could you please get me out of this blind world ? :'(

Antonio.

Show quoted text 11 lines
> Have a nice WE. You too! -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Ludo Brands
to Antonio Fortuny
Antonio Fortuny wrote 38 lines
Le 02/08/2013 17:22, Reinier Olislagers a ?crit : > On 02/08/2013 17:02, Antonio Fortuny wrote: >> I've copied the example from the wiki as a second test. >> I only set the pair login/password: same result as before (PAM >> autentication failed). >> Then I generated a pair of SSH2-rsa keys (1024) using puttygen and >> assigned the PrivateKey property to the private key file generated. >> Result is worse as an exception arises without explanation. > Read the wiki article. It should explain how to generate keys. The > format is not what you'd expect. Hi Reinier. I have had a complete read of http://wiki.lazarus.freepascal.org/Synapse. Maybe because it is monday morning, I haven't read any reference to how to generate keys for SSH connection Based upon the full exemple listed in the page, I've set up a simple front-end program. It's major code if the next snippet: var FClientSSh: TTelnetSSHClient; FClientSSh := TTelnetSSHClient.Create; FClientSSh.UserName := ELogin.Text; FClientSSh.Password := EPassword.Text; FClientSSh.HostName := EServerIP.Text; FClientSSh.Port := '22'; FClientSSh.ProtocolType := SSH; FClientSSh.PrivateKeyFile := EmptyStr; FClientSSh.Servertype := Unix; wLastErrorText := FClientSSh.Connect; exception: PAM autentication failed. Could you please get me out of this blind world ? :'(

Make also sure that the FPC binding for cryptlib (cryptlib.pas) corresponds with the version of the cryptlib library. The API for cryptlib is not binary compatible between versions. You can get all kind of weird bugs when there is a mismatch.

Ludo

Reply by email

Antonio Fortuny
to Ludo Brands

Le 05/08/2013 10:28, Ludo Brands a ?crit :

Show quoted text 42 lines
On 08/05/2013 10:11 AM, Antonio Fortuny wrote: > Le 02/08/2013 17:22, Reinier Olislagers a ?crit : >> On 02/08/2013 17:02, Antonio Fortuny wrote: >>> I've copied the example from the wiki as a second test. >>> I only set the pair login/password: same result as before (PAM >>> autentication failed). >>> Then I generated a pair of SSH2-rsa keys (1024) using puttygen and >>> assigned the PrivateKey property to the private key file generated. >>> Result is worse as an exception arises without explanation. >> Read the wiki article. It should explain how to generate keys. The >> format is not what you'd expect. > Hi Reinier. > > I have had a complete read of http://wiki.lazarus.freepascal.org/Synapse. > Maybe because it is monday morning, I haven't read any reference to how > to generate keys for SSH connection > Based upon the full exemple listed in the page, I've set up a simple > front-end program. > It's major code if the next snippet: > > var > FClientSSh: TTelnetSSHClient; > > FClientSSh := TTelnetSSHClient.Create; > > FClientSSh.UserName := ELogin.Text; > FClientSSh.Password := EPassword.Text; > FClientSSh.HostName := EServerIP.Text; > FClientSSh.Port := '22'; > FClientSSh.ProtocolType := SSH; > FClientSSh.PrivateKeyFile := EmptyStr; > FClientSSh.Servertype := Unix; > wLastErrorText := FClientSSh.Connect; > > exception: PAM autentication failed. > > Could you please get me out of this blind world ? :'( > Make also sure that the FPC binding for cryptlib (cryptlib.pas) corresponds with the version of the cryptlib library. The API for cryptlib is not binary compatible between versions. You can get all kind of weird bugs when there is a mismatch.

Done since I downloded CL32.dll as of version 3.4.2. Pascal file "cryptlib.pas" is included in the bundle.

Antonio.

Show quoted text 9 lines
Ludo -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Sita Software *Antonio Fortuny* Senior Software engineer 220, avenue de la Libert? L-4602 Niederkorn Tel.: +352 58 00 93 - 93 www.sitasoftware.lu <http://www.sitasoftware.lu> Your IT Partner -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130805/3882d6f3/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: fjgaafie.jpg Type: image/jpeg Size: 2306 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130805/3882d6f3/attachment.jpg> -------------- next part -------------- A non-text attachment was scrubbed... Name: ihafdafa.jpg Type: image/jpeg Size: 921 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130805/3882d6f3/attachment-0001.jpg>

Reply by email

Reinier Olislagers
to Antonio Fortuny: Le 02/08/2013 17:22, Reinier Olislagers a ?crit : Hi Reinier. I have had a complete read…
Antonio Fortuny wrote 14 lines
Le 02/08/2013 17:22, Reinier Olislagers a ?crit : > On 02/08/2013 17:02, Antonio Fortuny wrote: >> I've copied the example from the wiki as a second test. >> I only set the pair login/password: same result as before (PAM >> autentication failed). >> Then I generated a pair of SSH2-rsa keys (1024) using puttygen and >> assigned the PrivateKey property to the private key file generated. >> Result is worse as an exception arises without explanation. > Read the wiki article. It should explain how to generate keys. The > format is not what you'd expect. I have had a complete read of http://wiki.lazarus.freepascal.org/Synapse. Maybe because it is monday morning, I haven't read any reference to how to generate keys for SSH connection

Mmmph - I have that Monday morning feeling, too.

The wiki article says:
"LibSSH2 library. Pascal bindings still in development, but you can use a file with your private key (in OpenSSH format) to authenticate. " but you tried that and it didn't work - you *did* export the puttygen private key file in openssh format, not the default putty format!?

I thought I had an example with libssh2+certificate auth lying around somewhere but apparently I haven't, so that's about all I can say, sorry.

Reply by email

Reinier Olislagers
to Antonio Fortuny: Le 02/08/2013 17:22, Reinier Olislagers a ?crit : Hi Reinier. I have had a complete read…
Antonio Fortuny wrote 11 lines
Le 02/08/2013 17:22, Reinier Olislagers a ?crit : > On 02/08/2013 17:02, Antonio Fortuny wrote: >> I've copied the example from the wiki as a second test. >> I only set the pair login/password: same result as before (PAM >> autentication failed). >> Then I generated a pair of SSH2-rsa keys (1024) using puttygen and >> assigned the PrivateKey property to the private key file generated. >> Result is worse as an exception arises without explanation. > Read the wiki article. It should explain how to generate keys. The > format is not what you'd expect. Could you please get me out of this blind world ? :'(

Just to make sure: you do know that I talked about using libssh2 - not cryptlib - with the certificates, right?

if you have a sample test program I'd be happy to run it here and test...

Reply by email

Antonio Fortuny
to Reinier Olislagers: Mmmph - I have that Monday morning feeling, too. The wiki article says: "LibSSH2 library.…

Le 05/08/2013 11:07, Reinier Olislagers a ?crit :

Show quoted text 25 lines
On 05/08/2013 10:11, Antonio Fortuny wrote: > Le 02/08/2013 17:22, Reinier Olislagers a ?crit : >> On 02/08/2013 17:02, Antonio Fortuny wrote: >>> I've copied the example from the wiki as a second test. >>> I only set the pair login/password: same result as before (PAM >>> autentication failed). >>> Then I generated a pair of SSH2-rsa keys (1024) using puttygen and >>> assigned the PrivateKey property to the private key file generated. >>> Result is worse as an exception arises without explanation. >> Read the wiki article. It should explain how to generate keys. The >> format is not what you'd expect. > I have had a complete read of http://wiki.lazarus.freepascal.org/Synapse. > Maybe because it is monday morning, I haven't read any reference to how > to generate keys for SSH connection Mmmph - I have that Monday morning feeling, too. The wiki article says: "LibSSH2 library. Pascal bindings still in development, but you can use a file with your private key (in OpenSSH format) to authenticate. " but you tried that and it didn't work - you *did* export the puttygen private key file in openssh format, not the default putty format!? I thought I had an example with libssh2+certificate auth lying around somewhere but apparently I haven't, so that's about all I can say, sorry.

Aaaaaaaargh ! >:o
Definitely yes, IT IS monday morning.
I've read this text, but because I'm focused on cryptolib (ssl_cryptlib.pas and cryptlib.pas along with cl32.dll), I didn't take care of the LibSSH2 as the cryptolib seems to take care of the private key. In my mind the application has to play with a pair of keys like I use to do between two Linux boxes, exchanging eachother the gerated public key into the .ssh user's home folders. And yes, I saved putty's keys in OpenSSH format. When generating the keys, as I usually do with Linux boxes, I don't give a passphrase so I connect immediately. I still give a pair username/password (appropriate to the server into wich I want to connect.
BTW, isn't the public key used anymore ? As only the private key is mentioned, I wonder what to do with the public one.

Thanks anyway Reinier, I'll let you know if I succed to establish a connection.

Antonio.

Show quoted text 6 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Sita Software *Antonio Fortuny* Senior Software engineer 220, avenue de la Libert? L-4602 Niederkorn Tel.: +352 58 00 93 - 93 www.sitasoftware.lu <http://www.sitasoftware.lu> Your IT Partner -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130805/86d7cf8a/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: jgcchcag.jpg Type: image/jpeg Size: 2306 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130805/86d7cf8a/attachment.jpg> -------------- next part -------------- A non-text attachment was scrubbed... Name: ajadifjg.jpg Type: image/jpeg Size: 921 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130805/86d7cf8a/attachment-0001.jpg>

Reply by email

Reinier Olislagers
to Antonio Fortuny
Antonio Fortuny wrote 6 lines
Le 05/08/2013 11:07, Reinier Olislagers a ?crit : > On 05/08/2013 10:11, Antonio Fortuny wrote: >> Le 02/08/2013 17:22, Reinier Olislagers a ?crit : >>> On 02/08/2013 17:02, Antonio Fortuny wrote: Aaaaaaaargh ! >:o Definitely yes, IT IS monday morning.

I know the feeling ;)

BTW, isn't the public key used anymore ? As only the private key is mentioned, I wonder what to do with the public one.

IIRC, the public key goes into the server's .ssh directory for the relevant user account, as authorized_keys or something (I always forget the details, sorry)

Thanks anyway Reinier, I'll let you know if I succed to establish a connection.

No problem - good luck!

Reply by email