Hi Maciej,

If I understand correctly what you are asking, I think you should be able
to use ssh-agent to store your personal ssh authentication in your own
shell, without that agent interfering with anyone else's.

A fact perhaps not widely known is that if you prefix any command with
`ssh-agent`, that command will be executed as a subprocess of the agent.
This agent will not be shared with anyone else, so you can use it as a
wrapper to Bash or Zsh. Thus you can store your own private authentication
even though you're in a shared account.

Example session:

  login $ ssh-agent /bin/bash
  ssh-agent $ ssh-add /path/to/your/own/ssh-key.pub
  ssh-agent $ cd /path/to/repo
  ssh-agent $ git push [email protected]:<acct-name>/repo.git
  ssh-agent $ exit
  login $

You could also use, say, `screen` instead of `/bin/bash` to create a
session that persists between logins. However, this would allow anyone else
to appropriate your session for themselves using a `screen -dr ...`. Using
a one-off shell session is less convenient but more secure.


Kind regards,


Tim


On Thu, Feb 08, 2018 at 02:11:26AM -0800, Maciej Ł wrote:
> Hi! How can I cache GIT credentials in scope of a terminal session? My use 
> case is the following. Me and other developers share a single account on a 
> remote Linux machine. In a home directory we share a GIT project with 
> application-specific configuration files. Sometimes we need to pull/push 
> changes. I don't want to type my username and password every time. I also 
> don't want to cache my credentials in such a way that other developers 
> having simultaneous SSH sessions use my credentials to perform GIT 
> operations. How can I achieve this?
> 
> Maciej Ł.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to