Re: Netbeans 11.3 - can't push to remote

2021-01-19 Thread Ernie Rael

On 1/19/2021 5:25 PM, Jack W. wrote:

Thanks Thomas Wolf, but that didn't work for my situation.
Are there Issues on NB

https://issues.apache.org/jira/projects/NETBEANS/issues

ssh already or should I file one?

On Tue, Jan 19, 2021 at 5:41 PM Thomas Wolf > wrote:


FIGURED IT OUT!

And as is often the case, stackoverflow had the answer:

https://stackoverflow.com/questions/53134212/invalid-privatekey-when-using-jsch



---
Jack Woehr   # Woehr's Asymptote: The ratio of the time spent
Box 51, Golden CO 80402  # administering productivity software over 
the time
http://www.softwoehr.com  # saved by said 
software eventually approximates 1.




-
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Re: Netbeans 11.3 - can't push to remote

2021-01-19 Thread Thomas Wolf
 Sorry, I have no idea if there are any open issues in Apache NB regarding
this.  Wouldn’t even know where to look since the move to Apache.  I think
there’s a Jira board, but am not sure.

tom


On Jan 19, 2021 at 8:25:14 PM, Jack W.  wrote:

> Thanks Thomas Wolf, but that didn't work for my situation.
> Are there Issues on NB ssh already or should I file one?
>
> On Tue, Jan 19, 2021 at 5:41 PM Thomas Wolf  wrote:
>
>> FIGURED IT OUT!
>>
>> And as is often the case, stackoverflow had the answer:
>>
>> https://stackoverflow.com/questions/53134212/invalid-privatekey-when-using-jsch
>>
>>
> ---
> Jack Woehr   # Woehr's Asymptote: The ratio of the time spent
> Box 51, Golden CO 80402  # administering productivity software over the
> time
> http://www.softwoehr.com # saved by said software eventually approximates
> 1.
>


Re: Netbeans 11.3 - can't push to remote

2021-01-19 Thread Jack W.
Thanks Thomas Wolf, but that didn't work for my situation.
Are there Issues on NB ssh already or should I file one?

On Tue, Jan 19, 2021 at 5:41 PM Thomas Wolf  wrote:

> FIGURED IT OUT!
>
> And as is often the case, stackoverflow had the answer:
>
> https://stackoverflow.com/questions/53134212/invalid-privatekey-when-using-jsch
>
>
---
Jack Woehr   # Woehr's Asymptote: The ratio of the time spent
Box 51, Golden CO 80402  # administering productivity software over the time
http://www.softwoehr.com # saved by said software eventually approximates 1.


Re: Netbeans 11.3 - can't push to remote

2021-01-19 Thread Thomas Wolf
 FIGURED IT OUT!

And as is often the case, stackoverflow had the answer:
https://stackoverflow.com/questions/53134212/invalid-privatekey-when-using-jsch

It looks like jgit is using a version of openssh that requires a modifier
on the key generation!  I did the default "ssh-keygen -t rsa” when I
created my keys.  But for it to work with NB, I need to do "ssh-keygen -t
rsa -m PEM” - sweet jesus, how is anyone supposed to know that???

Anyway all works now.  Hope this is useful to someone else.

Tom



On Jan 19, 2021 at 7:23:06 PM, Thomas Wolf  wrote:

> Hi Peter,
> I looked at m .ssh directory and it already had the permissions you
> describe - the .ssh/ directory only had owner rwx and in the .ssh/
> directory, the public keys had rw permission for owner and r for group and
> other.  The private keys had rw for owner and no permission for anyone
> else.  The owner for everything was my userid.
>
> I even tried the reverse - giving group/other read permission to
> everything.  But that didn’t help either.  Lastly, I removed all but one
> set of keys from the .ssh/ directory - the one I use to ssh to the remote
> host (and where I’ve added its public key to the git user’s .ssh/
> authorized_keys file).  Still no good.  I can ssh to the remote machine and
> I can push using ‘git push origin master’, but when I try the push from
> Netbeans, I keep getting the same exception in the log :-(
>
> I downloaded and tried 12.2 and it gets the same exception :-(
>
> If anyone else has any other suggestions, I’d appreciate them.  The funny
> thing is that my work Mac has no problem pushing to other work computers
> with the same version of Netbeans and with the same permissions on the
> .ssh/ directory.  The work computer still uses catalina whereas the home
> computer uses a Big Sur 11.2 beta, but wouldn’t think that makes a
> difference.
> It’s starting to drive me up a wall :-(
>
>
>
> On Jan 19, 2021 at 5:18:33 PM, Peter Hull  wrote:
>
>> On Tue, 19 Jan 2021 at 21:56, Thomas Wolf  wrote:
>>
>>> On Jan 19, 2021 at 4:26:08 PM, Thomas Wolf  wrote:
>>>
 Hey everyone,
 I’ve got Nebeans 11.3 on macOS 11.2 and am trying to push my local
 changes to a recently created remote git repository.  But NB keeps telling
 me about invalid credentials (I used ssh private key) and when I look into
 the IDE log, I see this:
 …
>>>
>>> I *think* I had the same problem and the solution turned out to be the
>> permissions on the ~/.ssh directory. (not sure because it was a while ago
>> and I did something and then forgot about it!)
>> Try removing all permissions from group and other (command: chmod
>> g-rwx,o-rwx ~/.ssh)
>> On my mac,
>> $ ls -ld ~/.ssh
>> drwx--  17 peterhull  501  544 10 Oct 16:55 /Users/peterhull/.ssh
>>
>>
>>> Not sure how com.jcraft and org.eclipse packages are in the picture -
>>> are those just libs NB uses?
>>>
>>
>>  Yes, it uses jgit from the Eclipse project.
>>
>> Hope that helps
>>
>>


Re: Netbeans 11.3 - can't push to remote

2021-01-19 Thread Thomas Wolf
 Hi Peter,
I looked at m .ssh directory and it already had the permissions you
describe - the .ssh/ directory only had owner rwx and in the .ssh/
directory, the public keys had rw permission for owner and r for group and
other.  The private keys had rw for owner and no permission for anyone
else.  The owner for everything was my userid.

I even tried the reverse - giving group/other read permission to
everything.  But that didn’t help either.  Lastly, I removed all but one
set of keys from the .ssh/ directory - the one I use to ssh to the remote
host (and where I’ve added its public key to the git user’s .ssh/
authorized_keys file).  Still no good.  I can ssh to the remote machine and
I can push using ‘git push origin master’, but when I try the push from
Netbeans, I keep getting the same exception in the log :-(

I downloaded and tried 12.2 and it gets the same exception :-(

If anyone else has any other suggestions, I’d appreciate them.  The funny
thing is that my work Mac has no problem pushing to other work computers
with the same version of Netbeans and with the same permissions on the
.ssh/ directory.  The work computer still uses catalina whereas the home
computer uses a Big Sur 11.2 beta, but wouldn’t think that makes a
difference.
It’s starting to drive me up a wall :-(



On Jan 19, 2021 at 5:18:33 PM, Peter Hull  wrote:

> On Tue, 19 Jan 2021 at 21:56, Thomas Wolf  wrote:
>
>> On Jan 19, 2021 at 4:26:08 PM, Thomas Wolf  wrote:
>>
>>> Hey everyone,
>>> I’ve got Nebeans 11.3 on macOS 11.2 and am trying to push my local
>>> changes to a recently created remote git repository.  But NB keeps telling
>>> me about invalid credentials (I used ssh private key) and when I look into
>>> the IDE log, I see this:
>>> …
>>
>> I *think* I had the same problem and the solution turned out to be the
> permissions on the ~/.ssh directory. (not sure because it was a while ago
> and I did something and then forgot about it!)
> Try removing all permissions from group and other (command: chmod
> g-rwx,o-rwx ~/.ssh)
> On my mac,
> $ ls -ld ~/.ssh
> drwx--  17 peterhull  501  544 10 Oct 16:55 /Users/peterhull/.ssh
>
>
>> Not sure how com.jcraft and org.eclipse packages are in the picture - are
>> those just libs NB uses?
>>
>
>  Yes, it uses jgit from the Eclipse project.
>
> Hope that helps
>
>


Re: Netbeans 11.3 - can't push to remote

2021-01-19 Thread Jack W.
Having similar problem, asked about it on the list some weeks ago.
NB keeps insisting "invalid private key" for SFTP xfer to remote on run.

   - Source machine Ubuntu 20.04.1
   - Target machine is Fedora 33.

Very familiar with ssh setup. Interactive and scripted ssh to host works
flawlessly. Only NB chokes.


On Tue, Jan 19, 2021 at 3:18 PM Peter Hull  wrote:

> On Tue, 19 Jan 2021 at 21:56, Thomas Wolf  wrote:
>
>> On Jan 19, 2021 at 4:26:08 PM, Thomas Wolf  wrote:
>>
>>> Hey everyone,
>>> I’ve got Nebeans 11.3 on macOS 11.2 and am trying to push my local
>>> changes to a recently created remote git repository.  But NB keeps telling
>>> me about invalid credentials (I used ssh private key) and when I look into
>>> the IDE log, I see this:
>>>
>>>
-- 
---
Jack Woehr   # Woehr's Asymptote: The ratio of the time spent
Box 51, Golden CO 80402  # administering productivity software over the time
http://www.softwoehr.com # saved by said software eventually approximates 1.


Re: Netbeans 11.3 - can't push to remote

2021-01-19 Thread Peter Hull
On Tue, 19 Jan 2021 at 21:56, Thomas Wolf  wrote:

> On Jan 19, 2021 at 4:26:08 PM, Thomas Wolf  wrote:
>
>> Hey everyone,
>> I’ve got Nebeans 11.3 on macOS 11.2 and am trying to push my local
>> changes to a recently created remote git repository.  But NB keeps telling
>> me about invalid credentials (I used ssh private key) and when I look into
>> the IDE log, I see this:
>> …
>
> I *think* I had the same problem and the solution turned out to be the
permissions on the ~/.ssh directory. (not sure because it was a while ago
and I did something and then forgot about it!)
Try removing all permissions from group and other (command: chmod
g-rwx,o-rwx ~/.ssh)
On my mac,
$ ls -ld ~/.ssh
drwx--  17 peterhull  501  544 10 Oct 16:55 /Users/peterhull/.ssh


> Not sure how com.jcraft and org.eclipse packages are in the picture - are
> those just libs NB uses?
>

 Yes, it uses jgit from the Eclipse project.

Hope that helps


Re: Netbeans 11.3 - can't push to remote

2021-01-19 Thread Thomas Wolf
On Jan 19, 2021 at 4:26:08 PM, Thomas Wolf  wrote:

> Hey everyone,
> I’ve got Nebeans 11.3 on macOS 11.2 and am trying to push my local changes
> to a recently created remote git repository.  But NB keeps telling me about
> invalid credentials (I used ssh private key) and when I look into the IDE
> log, I see this:
>
> Caused: org.netbeans.libs.git.GitException$AuthorizationException:
> g...@xx.yy.zz.aa:SST.git: invalid privatekey: [B@1cc41291
> at
> org.netbeans.libs.git.jgit.commands.TransportCommand.handleException(TransportCommand.java:235)
> …
>
>
There was a little bit more stack trace above the lines I gave which may
provide more information:

com.jcraft.jsch.JSchException: invalid privatekey: [B@76e69deb
at com.jcraft.jsch.KeyPair.load(KeyPair.java:664)
at com.jcraft.jsch.KeyPair.load(KeyPair.java:561)
at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:40)
at com.jcraft.jsch.JSch.addIdentity(JSch.java:406)
at com.jcraft.jsch.JSch.addIdentity(JSch.java:366)
at
org.netbeans.libs.git.jgit.JGitSshSessionFactory.setupJSchIdentityRepository(JGitSshSessionFactory.java:184)
at
org.netbeans.libs.git.jgit.JGitSshSessionFactory.setupJSch(JGitSshSessionFactory.java:197)
Caused: org.eclipse.jgit.errors.TransportException: git@73.194.145.50:SST.git:
invalid privatekey: [B@76e69deb
at
org.netbeans.libs.git.jgit.JGitSshSessionFactory.setupJSch(JGitSshSessionFactory.java:199)
at
org.netbeans.libs.git.jgit.JGitSshSessionFactory.getSession(JGitSshSessionFactory.java:106)
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:140)
at
org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.(TransportGitSsh.java:280)
at
org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:170)
at
org.netbeans.libs.git.jgit.commands.ListRemoteObjectsCommand.runTransportCommand(ListRemoteObjectsCommand.java:51)
…

Not sure how com.jcraft and org.eclipse packages are in the picture - are
those just libs NB uses?
thnx again for any help,
Tom


Netbeans 11.3 - can't push to remote

2021-01-19 Thread Thomas Wolf
Hey everyone,
I’ve got Nebeans 11.3 on macOS 11.2 and am trying to push my local changes
to a recently created remote git repository.  But NB keeps telling me about
invalid credentials (I used ssh private key) and when I look into the IDE
log, I see this:

Caused: org.netbeans.libs.git.GitException$AuthorizationException:
g...@xx.yy.zz.aa:SST.git: invalid privatekey: [B@1cc41291
at
org.netbeans.libs.git.jgit.commands.TransportCommand.handleException(TransportCommand.java:235)
…

But the key isn’t invalid - I just created the private/public pair
yesterday (using "ssh-keygen -t rsa”) and I can ssh to the remote machine
from the terminal just fine.  Similarly, a ‘git push’ works fine as well.
Does anyone know what’s going on and how to fix this?

For completeness, here’s my .git/config (hostname modified to protect the
innocent) :-)
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = g...@xx.yy.zz.aa:SST.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master

Any insight much appreciated.  In the meantime, I guess I’ll download 12.2
- just in case it was a bug.
Tom

p.s. I also already tried clearing Library/Caches/Netbeans/11.3 - that
didn’t help either.