Announcement

Collapse
No announcement yet.

How to integrate KDE with ssh-agent / public key authentication

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [KDE] How to integrate KDE with ssh-agent / public key authentication

    I've been using Ubuntu with Unity for a long time but got fed up with it so I decided to switch to Kubuntu / KDE. While so far this has been a reasonably good experience, there's one thing I miss incredibly from Ubuntu: integration of ssh-agent, in for example kwallet.

    I'm a developer and I use many git repositories, which authenticate using public key authentication. I've secured my private key with a password which means I have to enter a password in order to use it.

    In Unity, the first time I would try to access a repository it would prompty me for the password, graphically. Each subsequent time in the same session it wouldn't, anymore, presumably due to the use of ssh-agent.

    In KDE, this behavior is fully absent. I get a prompt on the command line for my password, each and everytime I do any operation that accesses the remote repository.

    While I came across a package called ksshaskpass which presumably does something of what I want, it doesn't work. It tells me to export SSH_ASKPASS=/usr/bin/ksshaskpass but I still get a text-only prompt. I added it to my ~/.bashrc but that doesn't help. And as far as I can tell, it still start a ssh-agent session.

    So, what is the correct / recommended way to fix this?

    #2
    Do the following

    1. Remove ksshaskpass (sudo apt-get purge ksshaskpass)

    2. Then install ssh-askpass (sudo apt-get install ssh-askpass)

    Then create a little script:

    3. vi my-ssh-agent

    Paste this:

    #!/bin/sh
    # set SSH_ASKPASS if not set elsewhere
    export SSH_ASKPASS=/usr/bin/ssh-askpass
    ssh-add </dev/null

    4. Save the file (Esc , : , wq!)

    5. Make it executable (chmod +x my-ssh-agent)

    ---

    When you run the script (./my-ssh-agent) it will launch a gui where you type your passphrase in, this then saves your ssh passphrase whilst your logged in to your desktop.

    I have this script launch when I first login and then I never need to put my passphrase in again until I logout

    Comment


      #3
      I forgot to mention, in order to get it to launch on login move the script into ~/.kde/Autostart

      Comment

      Working...
      X