The dilemma: a Linux program that I'm working on should:
- Fetch a "package" over git+ssh:// protocol (using Git).
- Install that "package" in the system.
For git+ssh to work, Git needs to see my keys.
For the "package" installation, the program must have superuser privileges.
A limitation: the program should not elevate privileges (call sudo) by itself. User must explicitly invoke it with sudo. (Lets ignore the case when user runs the program while begin logged in as root — assuming he will setup keys correctly then.)
So, the question is: how to do ssh access with user keys from the program that is invoked with sudo?