0

I'm using Ubuntu's Startup Applications feature to run a script at startup. The script looks like this:

#! /bin/bash

dropBoxDevDir=/home/mitch/Dropbox/dev

set -e

yakuake &
python $dropBoxDevDir/scripts/ysess -i $dropBoxDevDir/configs/yakuake.ini
ssh-add

The idea is to:

  1. Run yakuake
  2. Run the ysess script to open some tabs in Yakuake
  3. Run ssh-add so that I can perform Git operations later on

The problem is that ssh-add doesn't seem to get run. How can I figure out why it doesn't get run?

Alternatively, is there a better way to run ssh-add after the other two commands have finished?

Mitch
  • 2,201
  • 3
  • 13
  • 19
  • what do you mean by "later on"? There is nothing "later on" in this script. – Jakuje Jun 23 '17 at 19:38
  • Does it matter? It's not related to the question. The question is clearly stated in the last two sentences. – Mitch Jun 23 '17 at 20:01
  • Yes. It does matter. It also matters if the ssh-agent or gnome keyring is already started in the startup script. And it also matters where the startup script should read the passphrapses for the encrytpted keys from. – Jakuje Jun 23 '17 at 20:07
  • As mentioned, I want to perform Git operations (e.g. `git push`) on repositories that are cloned with the `git:` protocol, which require me to use my SSH key. If I run `ssh-add` once beforehand, I can avoid the need to type my password each time. – Mitch Jun 24 '17 at 08:25

1 Answers1

0

I'm sure you've found an answer by now, but I saw this unanswered so...

I see 2 potential causes.

  1. I don't see where you've started ssh-agent. Looking at the man page for ssh-add it adds keys to a running ssh-agent, so that agent must be started first.

  2. Additionally the man page for ssh-add states that if no keys are given it will install some default keys, so if the agent is indeed running, I'd make sure those are the keys you want.

I used these commands for help:

man ssh-add
man ssh-agent

Hope this helps!