Questions tagged [ssh-agent]

'ssh-agent' is a program that used together with OpenSSH or similar SSH programs provides a secure way of storing the private key. Man Page https://www.freebsd.org/cgi/man.cgi?query=ssh-agent&apropos=0&sektion=0&manpath=FreeBSD+13.1-RELEASE+and+Ports&arch=default&format=html

A password-based authentication process (in the common example of OpenSSH) may be vulnerable to brute-force attacks, if no mechanism is in place to detect them. To mitigate this lack of security, ssh supports public key authentication.

In order to log in securely to a remote system via a secure shell, a private key/public key pair is generated. The private key is stored on the local machine. The public key is stored on the target machine in the $HOME/.ssh/authorized_keys file. Public keys are not sensitive information and may be known to anybody, whereas the private key needs to be protected very carefully by a strong passphrase.

ssh-agent remembers the decrypted private key so that the user does not need to type it every time he or she wants to connect or send data to the server.

Source: Wikipedia (ssh-agent)

348 questions
2187
votes
41 answers

Could not open a connection to your authentication agent

I am running into this error of: $ git push heroku master Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts. ! Your key with fingerprint b7:fd:15:25:02:8e:5f:06:4f:1c:af:f3:f0:c3:c2:65 is not…
Danny Dai Smith
  • 21,905
  • 3
  • 13
  • 3
816
votes
24 answers

Git keeps asking me for my ssh key passphrase

I created keys as instructed in the github tutorial, registered them with github, and tried using ssh-agent explicitly — yet git continues to ask me for my passphrase every time I try to do a pull or a push. What could be the cause?
Rogach
  • 26,050
  • 21
  • 93
  • 172
626
votes
13 answers

How to permanently add a private key with ssh-add on Ubuntu?

I have a private key protected with a password to access a server via SSH. I have 2 linux (ubuntu 10.04) machines and the behavior of ssh-add command is different in both of them. In one machine, once I use "ssh-add .ssh/identity" and entered my…
duduklein
  • 10,014
  • 11
  • 44
  • 55
408
votes
12 answers

Start ssh-agent on login

I have a site as a remote Git repo pulling from Bitbucket.com using an SSH alias. I can manually start the ssh-agent on my server but I have to do this every time I login via SSH. I manually start the ssh-agent: eval ssh-agent $SHELL Then I add the…
Pathsofdesign
  • 4,678
  • 5
  • 18
  • 26
94
votes
14 answers

How to auto-update SSH agent environment variables when attaching to existing tmux sessions?

I am trying to find a nice way to restore the SSH agent when I reconnect a disconnected tmux session. The cause seems to be that the SSH agent session changes but the environment variable from the tmux session is not updated. How can I automate…
sorin
  • 161,544
  • 178
  • 535
  • 806
73
votes
4 answers

SSH Agent Forwarding with Ansible

I’m using Ansible 1.5.3 and Git with ssh agent forwarding (https://help.github.com/articles/using-ssh-agent-forwarding). I can log into the server that I am managing with Ansible and test that my connection to git is correctly…
Bob Barcklay
  • 1,584
  • 1
  • 15
  • 22
57
votes
9 answers

TortoiseGit with openssh key not authenticating using ssh-agent

I'm setting up a git environment on Windows XP (msysGit 1.7.11, TortoiseGit 1.7.14) and trying to achieve following points : ssh connection on a port different than default 22 ssh authentification handled by ssh-agent So I create a ~/.ssh/config…
kraymer
  • 3,254
  • 1
  • 24
  • 32
54
votes
6 answers

Using git with ssh-agent on Windows

I'm on Windows. I installed git and posh-git (some helpers for Windows PowerShell). I can add keys with ssh-add and can authenticate with github and my webserver. I can also use git from the PowerShell to interact with my repositories. But there is…
LuMa
  • 1,673
  • 3
  • 19
  • 41
52
votes
9 answers

Cannot push to git repository - permission denied

I have a following problem: $ git push -u origin master Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. I have already checked the…
mc.suchecki
  • 1,898
  • 4
  • 23
  • 44
50
votes
0 answers

ssh-agent error "Could not open a connection to your authentication agent."

I need to add a public key to ssh-agent but I'm getting the following error Could not open a connection to your authentication agent. I'm using Windows 7. I found that agent is running. But ssh-add is useless as it gives an error above.
AndrewG
  • 1,429
  • 2
  • 16
  • 21
48
votes
7 answers

How to make ssh-add read passphrase from a file?

I am trying to add a key to ssh-agent and want ssh-add to read the password from the key file I'm using. How is this possible? How do I automate this process from the shell script?
Satish
  • 16,544
  • 29
  • 93
  • 149
47
votes
1 answer

How is SSH_AUTH_SOCK setup and used by ssh-agent?

I have been able to setup the sharing of ssh-agent for public-key authentication after reading https://superuser.com/a/230872/301446 The environment file thus generated has the following contents: SSH_AUTH_SOCK=/tmp/ssh-OwqeSuxmEsQN/agent.4744;…
user3104542
38
votes
7 answers

Getting ssh-agent to work with git run from windows command shell

I have msysgit installed, with OpenSSH. I am connecting to a gitosis repo. From the git bash, I have created a .profile file that runs ssh-agent (if not already running) each time git bash is opened, using this…
Jacko
  • 12,665
  • 18
  • 75
  • 126
35
votes
3 answers

Remember git passphrase in WSL

I run Windows 10 with WSL. I have the desired behaviour on one computer, but cannot replicate elsewhere. Here's what I'm after: First time I run a remote git command using my ssh key, git prompts me for the passphrase Subsequent times no prompt,…
Conan
  • 2,288
  • 1
  • 28
  • 42
31
votes
6 answers

GIT over SSH in Ansible hangs, eventhough ssh-agent forwarding is set up

I have set up everyhing I could find, but still cloning a repo from GitHub hangs the provisioning process. I have: server in known_hosts .ssh/config Host github.com ForwardAgent yes StrictHostKeyChecking no copied private key public key is in…
tillda
  • 18,150
  • 16
  • 51
  • 70
1
2 3
23 24