Rex icon indicating copy to clipboard operation
Rex copied to clipboard

Can private_key be used as a property for a server?

Open sdondley opened this issue 5 years ago • 1 comments

The documentation on configuring a server is thin.

I have this in Rexfile:

group "lightsails", "ilwu_big" => { user => 'my_user', private_key => '/path/to/key.pem' };

task 'uptime', 'ilwu_big', sub {
  say run 'uptime';
};

However, authentication fails. If I add the following above the task, however:

private_key '/path/to/key.pem';

The task runs.

sdondley avatar Apr 08 '20 01:04 sdondley

Thanks for the report!

Hmm, when I first started to reply, I noticed that there are at least the following factors in play here:

  • I'd expect the use_server_auth feature flag and/or some newer versioned feature flag would be needed for that notation to work
  • the task says the code is tied to the host named ilwu_big, and not to the group named lightsails (that would be task 'uptime', group => 'lightsails', sub {...};)
  • I would recommend auth for to override per-task or per-group authentication details

But then I could not make this use case for the private keys working in my quick local tests, so I think it's best to investigate it further as a potential bug.

To avoid duplication, I will cross-link this with the Rex Users group thread about the same topic, and only follow it here.

ferki avatar Apr 09 '20 16:04 ferki