Logging on to Azure

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
michael.rempel
Posts: 3
Joined: Fri 09 Mar 2018 03:38

Logging on to Azure

Post by michael.rempel » Fri 09 Mar 2018 04:00

I am having problems logging on to an Azure server.

All the options in various places are confusing me.

I have an existing Public/private key pair that has been tested using mac ssh and linux ssh. It works.

The key has a password on it, required to use the key.

The key has a user name. The user has a password, but the login proceeds without using it.

The key password and the user password are not the same.

The key was generated with
sshkeygen -f {keyname}
sshkeygen -f {keyname}.pub -e -m SSH2 >{keyname}


identity in config. locations and names changed.
Host my-host
IdentityFile ~.ssh/myPrivateKey
User my-user.name
Hostname my.ip.v4.address
ServerAliveInterval 60
TCPKeepAlive yes
ControlMaster auto
ControlPath ~/.ssh/_my-host
ControlPersist 8h

ssh my-host at the command line prompts me for a password, then lets me in.

I am using Delphi XE3 and the latest version of your software. Trial right now, but I paid for my version. Your server isnt letting me log on to get the registered one.

How do I make this work?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Logging on to Azure

Post by ViktorV » Mon 12 Mar 2018 15:43

Please write in more detail what is the essence of your question: you have an issue when connecting to an SSH server or you cannot get a licensed version of SecureBridge.
To connect to an SSH server, you can use the following recommendations:
- you can set the TScSSHClient.Authentication property to atPublicKey and the TScSSHClient.PrivateKeyName property to valid key name after importing the ppk file. Example:

Code: Select all

procedure Connect;
var
Key: TScKey;
begin
Key := TScKey.Create(ScFileStorage.Keys);
Key.KeyName := 'key1';
Key.ImportFrom('myPrivateKey');

ScSSHClient.Authentication := atPublicKey;
ScSSHClient.KeyStorage := ScFileStorage;
ScSSHClient.PrivateKeyName := 'key1';
ScSSHClient.Connect;
end;
If after getting acquainted, you have any specific questions left, or if there are any new ones, please ask and we will answer them.

michael.rempel
Posts: 3
Joined: Fri 09 Mar 2018 03:38

Re: Logging on to Azure

Post by michael.rempel » Tue 07 Aug 2018 16:15

To update this:
I got my registered copy of securebridge installed in Delphi XE3

I am trying to create the same SSH connection in it, as I have working in dbForge. I need to do it with port forwarding so that I can connect to MySQL.

The login is SSH2, I use a Putty generated PPK with a pass phrase on it. And it has a login name with user password.

By the way please allow people to reset their password with just their email. Requiring a user name too is frustrating, especially when I dont log on here often.

Thanks

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Logging on to Azure

Post by ViktorV » Fri 10 Aug 2018 10:28

To import a private key file that is password-protected, you should use the following code:

Code: Select all

// the password protected private key
Key.ImportFrom('C:\privatekey.ppk', password_for_key);
Note, such keys should be imported at runtime, they can not be imported at designtime.
You can use MyDAC (UniDAC) with SecureBridge components to connect to MySQL via the SSH protocol. You can get the information about connecting to MySQL server using SSH in our documentation: https://www.devart.com/mydac/docs/secureconnections.htm You can see an example of MyDAC (UniDAC) and SecureBridge co-working in the demo projects: %MyDACDemos% (%UniDACDemos%)\TechnologySpecific\SecureBridge, where %MyDACDemos% (%UniDACDemos%) is the MyDAC (UniDAC) Demo projects installation path on your computer.

michael.rempel
Posts: 3
Joined: Fri 09 Mar 2018 03:38

Re: Logging on to Azure

Post by michael.rempel » Wed 19 Sep 2018 21:31

This issue is still not resolved. Sorry it has been a while.

We want to limit access to Azure, and not have the ppk files distributed. We need to create the secure bridge file which grants specific local ports for our servers. Those servers have SSH to port 22 set up with RSA 2048 keys already.

This solution is very confusing to me, I cant seem to get it to work despite the fact that putty works just fine with these key files. Your documentation is not at all clear about what I need to do, and your suggestion that we cant use the ScFileStorage to store imported keys simply must be wrong. I cant run your code more than once, and the ScFileStorage reports that your file format is corrupt when I try to open it in design mode.

This package is not up to the standards I expect from Devart. It seems like a total hack.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Logging on to Azure

Post by ViktorV » Thu 20 Sep 2018 11:26

If you set the TScFileStorage.Algorithm and TScFileStorage.Password properties, then the private keys will be stored in encrypted form.
Please compose and send us using the contact form https://devart.com/company/contactform.html a full sample demonstrating the specified behavior and the key file, which you are trying to import.
Also, please, describe your task in more detail: how you implement your task solution using putty, what issues occurred with the SecureBridge components, etc., we will be able to give you some specific advice to solve your task.

Post Reply