Gitkraken, Linux Mint and ~/.ssh keys - gitkraken

Gitkraken: 6.0.0 installed via snap. Mint 19.1
I have started trying to use Gitkraken on Linux Mint. I dig that Mint is using GNU keyring or some-such by default but Gitkracken seems to ignore it as the "default" ssh agent. Command-line git ignores it as well.
If I start up a terminal window and start the openssh ssh-agent and then do an ssh-add of the keys in ~/.ssh I can then use command-line git just fine. If, in the same terminal window, I start Gitkraken it still will not recognize that I have ssh keys loaded.
If I go to Gk's settings and try to force it to use my ssh keys in ~/.ssh I am told that Gk does not have permissions to read the dir... it is running as me, I checked. It seems to prefer its own ssh dir in a snap config folder in my home dir. I can not change that as far as I know at this time.
what am I missing?
Edit
Addressing #kowsky's questions below in more detail:
I have tried setting gk's auth prefs: File -> Preferences -> Authentication. Under the General tab "use local ssh agent" is checked. Un-checking it offers me the opportunity to brows for ssh keys. By default Gk is pointing to an ssh dir under it's ~/snap/gitkraken/ dir. Navigating to my ~/.ssh dir yields a permission denied message.
My repo is on Bitbucket.org so I go to that tab and find that Gk "is connected" but trying to brows for ssh keys to add ends up with the same permission denied error.

Related

VSCode remote ssh -- how to automatically install extensions

How do I install VSCode extensions in an SSH connection without doing it through the VSCode UI? I have an environment that spins up a new VM for git branches, and it's really annoying to have to go manually install every extension for each new VM.
I've tried adding them to a devcontainer.json file, which is ignored (it only works on containers, not ssh, even in the newest release that's had some support for the file via ssh connections).
I could add a bunch of packages to vscode's settings, but I want to avoid that because what I install is different based on whether I'm looking at a rust service, node, etc and it's pretty pointless to install every conceivable package in every vm.
#get extendsions ids
cmd:
code --list-extensions
//foo.bar
//foo1.bar2
Visual Studio Code: Open settings file, add option:
"remote.SSH.defaultExtensions": [
"foo.bar",
]
ssh remote ssh rm ~/.vscode-server
vscode reconnect remote server

Vscode (code.exe) command line arguments to immediately open a remote workspace folder over SSH

If I want to open a workspace on a regular local folder under C:\ I can just execute the command:
code.exe C:\the-local-workspace-folder
Is there any equivalent command for opening remote SSH workspaces?
I want to be able to use my keyboard launcher to open them, rather than needing to open them the fiddly way in the internal menus inside vscode.
So I need a regular system command to be able to do this.
I've looked through the command line arguments here: https://code.visualstudio.com/docs/editor/command-line - but can't find anything about remote workspaces at all.
I've also tried commands like:
code.exe username#hostname.example.com:/workspace-folder
code.exe username#hostname.example.com/workspace-folder
...but they don't work for this.
This looks like a recent fix, according to the issue tracking here. I've tested with my own settings, and this works:
"C:\Users\myusername\AppData\Local\Programs\Microsoft VS Code\Code.exe" \
--remote ssh-remote+myubuntumachine /home/myusername/myprojectdirectory
The myubuntumachine should be the name given in the Host myubuntumachine in the SSH config file on CTRL+SHIFT+P/Remote SSH: Open Configuration File...
(Actually, on my machine I don't have the machine name, but some sort of hash value, although either works.)
VSCode 1.63 (Nov. 2021) adds the option -n (issue 137529), to make sure a new window is opened for remote CLI:
The following options got added to the remote CLI:
-n to open a new window of the same remote as the current window
-n --remote=wsl+ubuntu to open a new window of a different remote
-n --remote=local to open a new local window
To get started, you need to:
Install an OpenSSH compatible SSH client if one is not already present.
Install Visual Studio Code or Visual Studio Code Insiders.
Install the Remote Development extension pack.
Read more : https://code.visualstudio.com/docs/remote/ssh
Installations extension :
code.exe --install-extension ms-vscode-remote.remote-ssh
Follow the step-by-step tutorial or if you have a simple SSH host setup, connect to it as follows:
Press F1 and run the Remote-SSH: Open SSH Host... command. Enter
your user and host/IP in the following format in the input box that
appears and press enter: user#host-or-ip or
user#domain#host-or-ip If prompted, enter your password (but we suggest setting up key based authentication). After you are connected,
use File > Open Folder to open a folder on the host.
You can press F1 to bring up the Command Palette and type in Remote-SSH for a full list of available commands.
command list
You can change the location by launching VS Code with the --extensions-dir command-line option.
Where are extensions installed?#
Extensions are installed in a per user extensions folder. Depending on your platform, the location is in the following folder:
Windows %USERPROFILE%.vscode\extensions
Linux ~/.vscode/extensions
macOS ~/.vscode/extensions
To run remote ssh and open the folder in command-line :
code.exe --remote ssh-remote+root#server.com <your-directory>

VS code Remote Development problem with SSH connection (Windows to Linux)

I'm Currently trying to setup Remote developement environment with VS code.
I have installed Remote - SSH plugin and edited my .ssh/config file as below
Host ABC
User ubuntu
HostName xx.xx.xx.xx
IdentityFile ~/.ssh/filename
It trowing an error by saying "An SSH Installation couldn't be found"
Local Machine - Windows
Host Machine - Ubuntu(Linux)
Please help on this matter
You are missing an SSH tool in your host machine. Popular implementation of SSH protocol, OpenSSH is installed by default in Windows 10. First confirm if you have OpenSSH client by going to
Windows Settings >> Apps & features >> Optional Features
If not, install OpenSSH client through "Add a feature" option at the optional features page.
Mostly VSCode can pick the executable from common installation locations of the ssh.exe. If still not able to resolve, add the property below in VSCode settings
"remote.SSH.path": "your/ssh.exe/path"
like
"remote.SSH.path": "C:\Windows\System32\OpenSSH"
I have Windows 10 - 1608 version and it doesen't exist OpenSSH Feature in >> Optional Features.
I had downlosded OpenSSH seporately and now it's working as expected.
and another mistake I have done. I have tried to connect with .ppk key as the IdentityFile. And I have converted to private key using puttyGen. It is working perfectly now
Thanks for the help guys. Openssh was not present so had to install OpenSSH from Windows Powershell
https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse
Then copied the path of ssh.exe to VScode settings. Ex:
"remote.SSH.path": "C:\Program Files\OpenSSH-Win64\ssh.exe"
It worked perfectly.
Instead of installing OpenSSH, installing Git on Windows 7 also works because Git for Windows installs the SSH client. It ships OpenSSH with the package.

EGit not remembering SSH passphrase

Using the terminal git command and RabbitVCS, I am never asked for my SSH passphrase, since it is added to the SSH agent:
me#mymachine:~$ ssh-add -l
2048 s0:m3:f1:ng:3r:pr:1n:7... me#domain.tld (RSA)
Anyway, I have issues using EGit with Eclipse. I am prompted for my passphrase when I make an action that requires remote access.
After looking for solutions, I found this SO question: How to make eclipse remember ssh key passphrase?
Basically I have the same issue. So I tried to set the environment variable, restarted my machine but it just won't work...
me#mymachine:~$ echo $GIT_SSH
/usr/bin/ssh
(The environment variable is set in .bash-aliases like suggested in the other question)
Since this approach has not worked for me, I was looking for other possible issues which could prevent EGit from using the SSH key from the SSH agent, but in every question/topic/thread setting the environment variable fixed the problem for the people who had the same issue...
What can I do to make this running?
What else could lead to this behaviour?
What can I do to debug this?
Some more information:
Eclipse: Version: Luna Service Release 2 (4.4.2)
EGit: 4.0.1.201506240215-r (up-to-date)
Ubuntu: 15.04
The key was generated using ssh-keygen, and I dont want to use another key or create a new one
I found out that Eclipse was not aware of the GIT_SSH environment variable. When I ran Eclipse through the terminal, everything was fine. After I relaunched Eclipse from the Unity side panel, it refused to work again. My fix was to make a custom eclipse.desktop file in ~/.local/share/applications with the following content:
[Desktop Entry]
Type=Application
Name=Eclipse
Comment=Eclipse IDE
Icon=/opt/eclipse/icon.xpm
Exec=/opt/eclipse/eclipse_param.sh
Terminal=false
Categories=Development;IDE;Java;
StartupWMClass=Eclipse
Contents of /opt/eclipse/eclipse_param.sh
#!/bin/bash
export GIT_SSH=/usr/bin/ssh
/opt/eclipse/eclipse -showlocation
After these changes, everything worked as expected.

Eclipse: How to clone git over ssh with keyfile?

Hey, I am using Eclipse (while running Ubuntu 10.10) and would like to connect to a remote git. Normally I would use the egit plugin, but now I need to connect over ssh with keyfile.
Unfortunately egit has no "with keyfile" option, is there a way to connect to my repository with my keyfile?
Is there a "hidden" way to make Eclipse to pass parameters (-i keyfile) to ssh or something?
http://wiki.eclipse.org/EGit/User_Guide/Remote - I had to manually load my existing key in the "Key Management" tab.
I don't know anything about egit. But what you usually do is:
Start ssh-agent (mine is automatically started, when my window manager starts, so you have to google a bit how to setup it)
Run ssh-add [your key]
Use git over ssh as usual. It won't ask you for any passwords, since ssh-agent takes care of it.
HTH