This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 182863 - Not possible to provide SSH keys for remote terminal
Summary: Not possible to provide SSH keys for remote terminal
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: execution (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 normal (vote)
Assignee: Andrew Krasny
URL:
Keywords:
: 153425 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-26 10:18 UTC by Tomas Mysik
Modified: 2010-05-21 07:37 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Mysik 2010-03-26 10:18:15 UTC
It's not possible to provide SSH keys for remote terminal. For possible implementation, see php.project (have a look at org.netbeans.modules.php.project.connections.sftp package).

Product Version: NetBeans IDE Dev (Build 100325-afc95ecdb359)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01
System: Linux version 2.6.31-20-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 1 Tomas Mysik 2010-03-31 18:09:21 UTC
Sorry but I don't think that this is a P3 because it is quite common to have _only_ SSH key and _no_ password. In such case, remote terminal would be unusable.
Moreover, as I wrote, you can have a look at SftpClient in php.project, I guess the connection method could be more or less copy-pasted. Also, if I could help you somehow, I would be glad to do that.
Comment 2 Andrew Krasny 2010-04-02 16:12:20 UTC
OK, I have added some support of this. 
As I don't want to introduce any significant UI changes, I do not provide any visible setup for specifying keys file. By default ~/.ssh/id_rsa is used.
This could be changed by passing -J-Dssh.keys.file=<file>

The same is about known_hosts file. Default is ~/.ssh/known_host and property for changing it is ssh.knonwhosts.file.

Perhaps things like this could be moved on a higher level... (like http proxy)
Comment 3 Andrew Krasny 2010-04-02 16:15:48 UTC
The workflow is not well-defined yet... So we are prompting for a password as before... But if keys are configured, they will be used.

 
changeset: http://hg.netbeans.org/cnd-main/rev/957c9d39bfae

I will close this IZ as fixed. Workflow issues should be filed separately, I think.
Comment 4 Tomas Mysik 2010-04-05 15:41:19 UTC
(In reply to comment #2)
> As I don't want to introduce any significant UI changes

Why? There's no UI freeze yet...

> I do not provide any
> visible setup for specifying keys file. By default ~/.ssh/id_rsa is used.
> This could be changed by passing -J-Dssh.keys.file=<file>

Hmm, too bad for _all_ the Windows users.

> The same is about known_hosts file. Default is ~/.ssh/known_host and property
> for changing it is ssh.knonwhosts.file.

The same as above.
Comment 5 Tomas Mysik 2010-04-05 15:45:11 UTC
(In reply to comment #3)
> The workflow is not well-defined yet... So we are prompting for a password as
> before... But if keys are configured, they will be used.

Please notice that the JSCH library asks often for passwords itself.

> I will close this IZ as fixed. Workflow issues should be filed separately, I
> think.

Of course, I cannot agree - reasons in my previous commnent (well, in almost all my comments). IMHO the feature as it is implemented now, is not usable for most of NB users.
Comment 6 Tomas Mysik 2010-04-06 14:04:01 UTC
Reopening, reasons can be found in my previous comments.

(In reply to comment #2)
> visible setup for specifying keys file. By default ~/.ssh/id_rsa is used.
> This could be changed by passing -J-Dssh.keys.file=<file>

And what to do if user has different keys for different servers?
Comment 7 Leonid Lenyashin 2010-04-23 14:40:09 UTC
If it is targeted to 6.9 then it must be implemented by next Tue COB.
Comment 8 Leonid Lenyashin 2010-04-28 10:51:30 UTC
Anyway it looks like Andrew is on it.
Comment 9 Andrew Krasny 2010-04-29 10:14:34 UTC
Tomas,

there was a push with related changes recently. The UI is not final yet, but you are welcome to give it a try and share your opinion.

Thanks, 
=Andrew
Comment 10 Tomas Mysik 2010-05-03 19:53:41 UTC
(In reply to comment #9)
> there was a push with related changes recently. The UI is not final yet, but
> you are welcome to give it a try and share your opinion.

Where can I find it please? I tried to open a remote terminal (Window > Output > Terminal - Remote Terminal) but no SSH key can be specified. Am I missing something<

Thanks.

Product Version: NetBeans IDE Dev (Build 100503-2da28aa3df98)
Java: 1.6.0_20; Java HotSpot(TM) 64-Bit Server VM 16.3-b01
System: Linux version 2.6.31-21-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 11 Andrew Krasny 2010-05-04 13:24:12 UTC
Window->Output->Terminal(Experimental)-> Create New Remote Terminal Tab -> 

Enter User/Host/Port -> OK. At this point it should ask for authentication method... 

(you may need to start with a fresh userdir)

=Andrew
Comment 12 Tomas Mysik 2010-05-05 10:29:05 UTC
Yes, it works fine now, thanks. Maybe one question - info says that the credentials can be edited in remote server properties - where can one find it, please?
Comment 13 Andrew Krasny 2010-05-05 11:42:18 UTC
There is no 'global' settings related to remote hosts that belong to the platform ;( [and likely this will not be done in this release]

So these hosts properties are only available when CND module is installed. 

So the only way for you (for now) is to remove/edit {userdir}/config/Preferences/org/netbeans/modules/dlight/nativeexecution.properties file. 


=Andrew
Comment 14 Tomas Mysik 2010-05-05 12:24:29 UTC
(In reply to comment #13)
> There is no 'global' settings related to remote hosts that belong to the
> platform ;( [and likely this will not be done in this release]
> 
> So these hosts properties are only available when CND module is installed. 
> 
> So the only way for you (for now) is to remove/edit
> {userdir}/config/Preferences/org/netbeans/modules/dlight/nativeexecution.properties
> file. 

Aha, OK. So, my suggestion is - downgrade this bug to P3 (and TM NEXT) or maybe better, close this one and create a new one for remote server settings.

Thanks a lot.
Comment 15 Andrew Krasny 2010-05-05 16:51:55 UTC
Good. Last changes (workflow slightly changed for the initial host setup).
http://hg.netbeans.org/cnd-main/rev/83c6881b7dac

Will file another issue that need to provide an access to hosts properties when CND is not installed (for users of internal terminal)
Comment 16 Andrew Krasny 2010-05-05 17:11:47 UTC
Reference IZ: http://netbeans.org/bugzilla/show_bug.cgi?id=179464
Comment 17 Alexey Vladykin 2010-05-21 07:37:45 UTC
*** Bug 153425 has been marked as a duplicate of this bug. ***