Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366188 - Add support for 'authorized_keys' file to SSH console
Summary: Add support for 'authorized_keys' file to SSH console
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Components (show other bugs)
Version: 3.8.0 Juno   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: Juno M7   Edit
Assignee: Lazar Kirchev CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-09 09:23 EST by Gunnar Wagenknecht CLA
Modified: 2012-04-10 10:07 EDT (History)
4 users (show)

See Also:
l.kirchev: iplog+


Attachments
Patch containing documentation for the fix. (1.91 KB, patch)
2012-04-08 09:37 EDT, Lazar Kirchev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gunnar Wagenknecht CLA 2011-12-09 09:23:03 EST
The new Equinox SSH console is based on SSHD and allows secure connections using SSH. The nice thing of SSH is key based authentication. A common format to specify allowed keys is using an 'authorized_keys' file as typically found on Unix systems.

It should be possible to feed the SSH server with such a file in order to allow login using a key.
Comment 1 Gunnar Wagenknecht CLA 2011-12-09 09:23:46 EST
I pushed the first attempt here:
https://github.com/eclipseguru/rt.equinox.bundles/tree/ssh_authorized_keys

If a system property 'ssh.server.authorized_keys' is specified it may point to a file which contains a list of keys that are allowed to connect to the SSH console. The file will be read every time a connection is made so that it can be modified dynamically at runtime.
Comment 2 Gunnar Wagenknecht CLA 2011-12-09 09:44:44 EST
The commit to pull is:
https://github.com/eclipseguru/rt.equinox.bundles/commit/c182c5bc903bb81e55b01d2797a9d70220dd24e2

I wrote all this code and have the rights to contribute it to Eclipse under the eclipse.org web site terms of use.
Comment 3 Lazar Kirchev CLA 2011-12-13 08:51:37 EST
(In reply to comment #2)
> The commit to pull is:
> https://github.com/eclipseguru/rt.equinox.bundles/commit/c182c5bc903bb81e55b01d2797a9d70220dd24e2
> 
> I wrote all this code and have the rights to contribute it to Eclipse under the
> eclipse.org web site terms of use.


Thanks a lot for the contribution, Gunnar! This certainly will make usage of the ssh easier. I just submitted it to the original project with commit
http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=9feee7d4bc2425d1592b49ebd2d91f7964bc5c28

Could you also provide a test for the feature?
Comment 4 Thomas Watson CLA 2011-12-14 08:37:11 EST
Does this now allow login without the jaas stuff?
Comment 5 Gunnar Wagenknecht CLA 2011-12-14 08:42:26 EST
(In reply to comment #4)
> Does this now allow login without the jaas stuff?

Yes. Currently it accepts anything as username as long as a matching SSH key is specified in the file.
Comment 6 Gunnar Wagenknecht CLA 2012-02-25 18:25:44 EST
Lazar,

I have two more commits which improve the extensibility of the SSH console.

Any bundle (with sufficient permission) may provide an authenticator by registering an OSGi service. If no specific authorized_keys file is configured (via system property) the OSGi service registry will be searched for available authenticators.

https://github.com/eclipseguru/rt.equinox.bundles/commit/ec7d1c4ae60bdf65ebd53596e8142a27b80c6da5
https://github.com/eclipseguru/rt.equinox.bundles/commit/193b9e948d8d2134bd62b24c751a62f714d8c4b5

Let me know if you have any questions.
Comment 7 Lazar Kirchev CLA 2012-03-03 08:19:20 EST
(In reply to comment #6)
> Lazar,
> 
> I have two more commits which improve the extensibility of the SSH console.
> 
> Any bundle (with sufficient permission) may provide an authenticator by
> registering an OSGi service. If no specific authorized_keys file is configured
> (via system property) the OSGi service registry will be searched for available
> authenticators.
> 
> https://github.com/eclipseguru/rt.equinox.bundles/commit/ec7d1c4ae60bdf65ebd53596e8142a27b80c6da5
> https://github.com/eclipseguru/rt.equinox.bundles/commit/193b9e948d8d2134bd62b24c751a62f714d8c4b5
> 
> Let me know if you have any questions.

Thanks Gunnar,

Contribution submitted with commit http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=f8ceac0dbadd22dc7e587d0bc1cb0505e9fc4a93

Lazar
Comment 8 Lazar Kirchev CLA 2012-04-08 07:07:00 EDT
Currently if no authorized_keys file is specified, the ssh console always searches for registered authenticator services for custom public keys authentication. I changed this behavior so that the console now searches for registered authenticator services only if explicitly specified by setting ssh.custom.publickeys.auth=true.

Added with commit
http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=b7f03fdfb8b04a9dbe8f40a7e7b5316b17c77801
Comment 9 Gunnar Wagenknecht CLA 2012-04-08 07:41:56 EDT
(In reply to comment #8)
> Currently if no authorized_keys file is specified, the ssh console always
> searches for registered authenticator services for custom public keys
> authentication. I changed this behavior so that the console now searches for
> registered authenticator services only if explicitly specified by setting
> ssh.custom.publickeys.auth=true.

+1 

The behavior doesn't need to be enabled by default. Having this optional is a good idea (as we discussed at EclipseCon).
Comment 10 Lazar Kirchev CLA 2012-04-08 09:37:57 EDT
Created attachment 213730 [details]
Patch containing documentation for the fix.
Comment 11 Lazar Kirchev CLA 2012-04-08 09:38:45 EDT
(In reply to comment #10)
> Created attachment 213730 [details]
> Patch containing documentation for the fix.

Tom, could you apply this documentation patch?
Comment 12 Thomas Watson CLA 2012-04-09 09:06:14 EDT
(In reply to comment #11)
> (In reply to comment #10)
> > Created attachment 213730 [details]
> > Patch containing documentation for the fix.
> 
> Tom, could you apply this documentation patch?

hmmm, unfortunately my id no longer can commit to this repo.  I opened a bug with the foundation to get this fixed.
Comment 13 Thomas Watson CLA 2012-04-10 10:07:11 EDT
(In reply to comment #11)
> (In reply to comment #10)
> > Created attachment 213730 [details]
> > Patch containing documentation for the fix.
> 
> Tom, could you apply this documentation patch?

Done.

http://git.eclipse.org/c/platform/eclipse.platform.common.git/commit/?id=a98ae21883ced8728a00619dfba38a0c89599543

Closing as fixed.