On Fri, Aug 10, 2018 at 01:00:03PM +0200, Martin Steigerwald wrote: > > As it turns out, I do something very differnt which is my .bashrc will > > run ~/.ssh-setup, which looks for existing ssh-agents or gpg-agents, > > and if it one doesn't exist, it will start one, e.g.: > > I would not do this for the root user. I so not think it is wise to run > a ssh-agent or gpg-agent as root. To avoid that is the whole point of my > change to tell sudo to take over the environment for the SSH agent of > the user. I don´t even know why I would like searching for any running > SSH agent.
Starting a ssh-agent in practice never happens for the root user. There's an ssh-agent or a gpg-agent running before I su or sudo as root, so that part of the script never runs. The reason why searching for an SSH agent makes sense is for when I ssh into my desktop, and I want to use the pre-existing ssh-agent running on my desktop. Cheers, - Ted