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 <tjw...@gmail.com> 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 <peterhul...@gmail.com> wrote: > >> On Tue, 19 Jan 2021 at 21:56, Thomas Wolf <tjw...@gmail.com> wrote: >> >>> On Jan 19, 2021 at 4:26:08 PM, Thomas Wolf <tjw...@gmail.com> 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 >> >>