IceCredentialsProvider sshCredentials ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

IceCredentialsProvider sshCredentials ?

Sven Van Caekenberghe-2
I am trying to deploy on a server by building a Pharo image there.

I want to use a readonly 'deploy user', using a specific certificate.

I have been trying lots of things, but I cannot get where I want.

So the user account is arbitrary, it just contains a key pair. If I add the key pair to the ssh-agent, I can clone my repository on the command line.

Now I want to script this from Pharo. The script starts as follows:

| remote location |
remote := IceGitRemote url: 'ssh://[hidden email]:1234/tthree/t3-pharo.git'.
location := FileLocator localDirectory / 'iceberg' / remote projectName.

IceRepositoryCreator new
  remote: remote;
  location: location;
  createRepository.

On my development machine (macOS), this works fine.
But this does not work on the Linux server, it says

IceAuthenticationError: There was an authentication error while trying to execute the operation: .
This happens usually because you didn't provide a valid set of credentials.
You may fix this problem in different ways:

1. adding your keys to ssh-agent, executing ssh-add ~/.ssh/id_rsa in your command line.
2. adding your keys in settings (open settings browser search for "Use custom SSH keys" and
add your public and private keys).
3. using HTTPS instead SSH (Just use an url in the form HTTPS://etc.git)

It does not matter if the ssh-agent has the certificate listed (ssh-add).

Adding

IceCredentialsProvider useCustomSsh: true.
IceCredentialsProvider sshCredentials
        publicKey: '/home/t3/.ssh/id_deploy_pharo_ed25519.pub';
        privateKey: '/home/t3/.ssh/id_deploy_pharo_ed25519'

Does not make a difference. Is this supposed to work ?

Maybe there is some other problem ?

Sven


Reply | Threaded
Open this post in threaded view
|

Re: IceCredentialsProvider sshCredentials ?

Tim Mackinnon
Not sure if this helps - but that error is rather arbitrary.

I  got the same when I deleted the local iceberg directory vs my project directory in iceberg. Could this be a possibility? It doesn’t react well to missing directories?

Tim

Sent from my iPhone

> ?On 7 May 2019, at 15:33, Sven Van Caekenberghe <[hidden email]> wrote:
>
> I am trying to deploy on a server by building a Pharo image there.
>
> I want to use a readonly 'deploy user', using a specific certificate.
>
> I have been trying lots of things, but I cannot get where I want.
>
> So the user account is arbitrary, it just contains a key pair. If I add the key pair to the ssh-agent, I can clone my repository on the command line.
>
> Now I want to script this from Pharo. The script starts as follows:
>
> | remote location |
> remote := IceGitRemote url: 'ssh://[hidden email]:1234/tthree/t3-pharo.git'.
> location := FileLocator localDirectory / 'iceberg' / remote projectName.
>
> IceRepositoryCreator new
> remote: remote;
> location: location;
> createRepository.
>
> On my development machine (macOS), this works fine.
> But this does not work on the Linux server, it says
>
> IceAuthenticationError: There was an authentication error while trying to execute the operation: .
> This happens usually because you didn't provide a valid set of credentials.
> You may fix this problem in different ways:
>
> 1. adding your keys to ssh-agent, executing ssh-add ~/.ssh/id_rsa in your command line.
> 2. adding your keys in settings (open settings browser search for "Use custom SSH keys" and
> add your public and private keys).
> 3. using HTTPS instead SSH (Just use an url in the form HTTPS://etc.git)
>
> It does not matter if the ssh-agent has the certificate listed (ssh-add).
>
> Adding
>
> IceCredentialsProvider useCustomSsh: true.
> IceCredentialsProvider sshCredentials
>   publicKey: '/home/t3/.ssh/id_deploy_pharo_ed25519.pub';
>   privateKey: '/home/t3/.ssh/id_deploy_pharo_ed25519'
>
> Does not make a difference. Is this supposed to work ?
>
> Maybe there is some other problem ?
>
> Sven
>
>


Reply | Threaded
Open this post in threaded view
|

Re: IceCredentialsProvider sshCredentials ?

ducasse
In reply to this post by Sven Van Caekenberghe-2

did you try to clone your repo by hand on your server?
in my config I have also my github account/password

> On 7 May 2019, at 16:33, Sven Van Caekenberghe <[hidden email]> wrote:
>
> I am trying to deploy on a server by building a Pharo image there.
>
> I want to use a readonly 'deploy user', using a specific certificate.
>
> I have been trying lots of things, but I cannot get where I want.
>
> So the user account is arbitrary, it just contains a key pair. If I add the key pair to the ssh-agent, I can clone my repository on the command line.
>
> Now I want to script this from Pharo. The script starts as follows:
>
> | remote location |
> remote := IceGitRemote url: 'ssh://[hidden email]:1234/tthree/t3-pharo.git'.
> location := FileLocator localDirectory / 'iceberg' / remote projectName.
>
> IceRepositoryCreator new
>  remote: remote;
>  location: location;
>  createRepository.
>
> On my development machine (macOS), this works fine.
> But this does not work on the Linux server, it says
>
> IceAuthenticationError: There was an authentication error while trying to execute the operation: .
> This happens usually because you didn't provide a valid set of credentials.
> You may fix this problem in different ways:
>
> 1. adding your keys to ssh-agent, executing ssh-add ~/.ssh/id_rsa in your command line.
> 2. adding your keys in settings (open settings browser search for "Use custom SSH keys" and
> add your public and private keys).
> 3. using HTTPS instead SSH (Just use an url in the form HTTPS://etc.git)
>
> It does not matter if the ssh-agent has the certificate listed (ssh-add).
>
> Adding
>
> IceCredentialsProvider useCustomSsh: true.
> IceCredentialsProvider sshCredentials
> publicKey: '/home/t3/.ssh/id_deploy_pharo_ed25519.pub';
> privateKey: '/home/t3/.ssh/id_deploy_pharo_ed25519'
>
> Does not make a difference. Is this supposed to work ?
>
> Maybe there is some other problem ?
>
> Sven
>
>