On Wed, Jan 13, 2016 at 09:55:53AM +0200, Shahar Havivi wrote:
Hi,
I am successfully importing VM from Xen server at oVirt project via virt-v2v.
I am setting ssh-agent and running ssh-add before the import process,
after the import done I am trying to kill the agent via:
ssh-agent -k (and setting the SSH_AGENT_PID environment), but I get the
following error:
kill: No such process
Can you please explain why there is no agent?
When you run:
eval `ssh-agent`
ssh-agent starts up and creates several environment variables (which
are added to the environment, because you use the eval `..`).
In particular it sets SSH_AGENT_PID to its own PID.
ssh-agent -k is supposed to read SSH_AGENT_PID from the environment
and kill the previously started ssh-agent process, basically killing
that PID.
It works for me and for lots of other people, so I'm guessing you must
either be running ssh-agent wrongly the first time, or getting the
SSH_AGENT_PID environment variable mixed up somewhere.
Do I need to delete the agent?
Not necessarily, but if you don't kill the agent then two bad things
can happen: (1) You get lots of ssh-agent processes building up
(2) The ssh-agent processes may be storing your unencrypted private
keys. Except that ...
btw I am also running 'ssh-add -d' after the import process
with no problems.
... ssh-add -d will remove the private key from the agent. However
the agent should still be running after this, so it would have no
effect on whether ssh-agent -k would succeed.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/