This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to run ssh-add on startup

Tags: None
(comma "," separated)
apoi
Registered Member
Posts
10
Karma
0

How to run ssh-add on startup

Sat Jul 09, 2016 4:23 pm
I'd like to run ssh-add on startup to add my identities to ssh-agent. On my previous Plasma 5 installation with Kubuntu I had this working with the .desktop file method, similar to the one described in https://gist.github.com/MarkusH/1d4ef0ad168483ad6d3d.

This doesn't work any more for me. The .desktop file entry is shown in Autostart Desktop Files in System Settings, but apparently doesn't get run on startup, as I still need to execute the ssh-add.sh script manually to add the identities. Has anyone this solved in some way? Or alternatively, is there a way to see what's going wrong with the autostart execution?

Last edited by apoi on Sun Jul 10, 2016 11:02 am, edited 2 times in total.
apoi
Registered Member
Posts
10
Karma
0

Re: How to run ssh-add on startup

Sat Jul 09, 2016 4:28 pm
Ok, this was of course straightforward in the end. The ssh-add script needs to be added to the Script File section at Autostart, works great after that -- no need for the .desktop file kludge any more.

Edit: Not so fast. It seems I need *both* the script and the desktop file for this to work. I'm a bit baffled, let's see if this keeps working or what.
apoi
Registered Member
Posts
10
Karma
0

Re: How to run ssh-add on startup

Tue Aug 02, 2016 6:28 pm
Just to update on this -- no, it does not work. For now I'm just running ssh-add manually after each startup.
alexsid
Registered Member
Posts
20
Karma
0

Re: How to run ssh-add on startup

Mon Aug 08, 2016 5:41 pm
1. Create a script, e.g.

=============/usr/local/sbin/ssh-add.sh=======================
#!/bin/sh
export SSH_ASKPASS=/usr/bin/ksshaskpass
/usr/bin/ssh-add </dev/null
==========================================================

You do not necessarily need 'export SSH_ASKPASS=/usr/bin/ksshaskpass' line if you have a proper symlink, see manpage for 'ksshaskpass'

2. Go to System Settings->Startup and Shutdown->Autostart

and add this script

Hope this helps,
Alex


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Sogou [Bot]