Setup Kate for SSH access on GitHub

I hope this is not the wrong place to ask: as I was not able to find any documentation on the matter can someone tell me if there is a way to configure the SSH access from within kate to be able to push to remote repo. The only solution I’ve found so far is to launch Kate from within the terminal session where I’ve already setup the ssh-agent. If I simply launch Kate from the applications menu and try to setup the ssh-agent from within the Kate Konsole panel or within the project console panel, a push attempt will simply return a neat: git push error: git@github.com: Permission denied (publickey) error.

Thanks in advance

There are documentation here:

For connections read “Authentication”

There are multiple ways of getting access via SSH. Maybe you can use github-cli with gh auth login, depends on how you set everything up.

Thanks for your answer.
However my doubt are not on how to setup SSH access from the command line but from within Kate itself, if actually possible.
Let me explain better: my SSH access from the terminal is ok, i can perform any action with the git command line utility to the remote repo and when I run Kate from within that terminal session (where the SSH access is already configured), Kate is able to push to the remote GitHub repository without any issue.
My question is if we can configure Kate in some way to keep the SSH connection details so when we open the editor in a future desktop session we do not need to first setup the ssh-agent from within a terminal and then start Kate from there.
Thanks again

1 Like

Ah, I see. You want kate to start the SSH-agent if it is not already started?
Sorry, I do not know and can not help with that.

My suggestion is to just open the integrated terminal in Kate and start the ssh agent if needed.

I have kate set up to use the same profile by default as Konsole or Yakuake and it works fine, so I know it’s possible. (Kate even has a version control plugin!)

Could you not add a command to .bashrc or .zshrc to start the agent?

As I wrote in my first post, setup the ssh-agent from within the Kate Konsole panel or within the Kate project console does not work. Thanks anyway

1 Like

I’ll do some more tries on this. Thank you for your answer

What do you mean by that?
If it does not work through the console in dolphin, it will not work in ANY console (cli), it is just a console like any other. Be it Konsole, yakuake or even TTY, they are all exactly the same in this regard.

This makes zero sense. Again, the console in Kate is the same as any other console on your system.

Ok, I’ll try to explain it in other words.

The following will work:

  1. open Konsole and run the ssh-agent
  2. same Konsole session, add the GitHub related Key to the ssh-agent (ssh-add)
  3. again same Konsole session, run Kate simply issueing the kate command.

The following will NOT work:

  1. open Kate from desktop application launcher
  2. open the Konsole panel of Kate and with that terminal session reproduce the steps 1 and 2 of the working procedure above

Kate Will not gain ssh authentication through the ssh-agent running within its Konsole panel.

Anyway, in the meantime I’ve solved using the systemd ssh-agent.service provided by OpenSSH.
Thank you all and Happy coding

Make sure you have your paths correct, because if you open a file you most likely no longer will be in your home. That would be the ONLY explanation I could find. Because if you do not get any errors trying to run the commands from the Kate console but your system acts differently, there is some kind of bug involved.

That’s how I would do it if I would find it annoying to run a tiny script I made each time I want to connect. xD

You too! Glad you figured it out, even though the console in Kate thing sounds VERY strange.

1 Like

SSH access does not mean “terminal access”.

I can log in via SSH with VS Code, Emacs or almost any other GUI-based IDE or editor, including Notepad++.

That’s what the OP is asking: How to access and edit files on a remote host via SSH from teh Kate GUI, not the terminal included.

It would be frankly ridiculous to start Kate, open a terminal, SSH to the remote host and then start vim or emacs on that terminal to edit the files.

:wink:

  • Click on “Open File”
  • The location bar will show a recent path, remove it
  • When the current path is removed you will see a drop-down menu with a long list of protocols
  • Select SFTP
  • type in the location of the remote or the full path to teh file

That’s it :slight_smile:

You can also bookmark the location in Dolphin using the same procedure, but now you will have the option to add it to your favourite location. Once done you can choose that bookmark in Kate :wink:

I understood the original question to be not about editing files directly on a remote host, but about pushing to a git repo using the key in the ssh-agent to authenticate with the remote (I assume using Kate’s git plugin, although it seemed like the responses assumed using the terminal in Kate, to much confusion):

Thanks for posting how you edit files on a remote machine, though, that is helpful!

1 Like