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
30
votes
5 answers

Git- How to kill ssh-agent properly on Linux

I am using git on linux, when pushing to gitlab, sometimes it either stuck at: debug1: Connecting to gitlab.com [52.167.219.168] port 22. or debug1: client_input_channel_req: channel 0 rtype keepalive@openssh.com reply 1 debug3: send packet: type…
Eric
  • 22,183
  • 20
  • 145
  • 196
25
votes
6 answers

Ansible SSH forwarding doesn't seem to work with Vagrant

OK, strange question. I have SSH forwarding working with Vagrant. But I'm trying to get it working when using Ansible as a Vagrant provisioner. I found out exactly what Ansible is executing, and tried it myself from the command line, sure enough, it…
binarytemple_picsolve
  • 2,546
  • 2
  • 15
  • 15
18
votes
5 answers

How to extract private keys from an ssh-agent?

ssh-add -l displays that I have 3 RSA keys added to my SSH agent. ssh-add -L displays those public keys. How do I get the private keys as well, so that I can save them to a file? Or is it by design that this is impossible? How does it work then? Can…
pts
  • 80,836
  • 20
  • 110
  • 183
17
votes
2 answers

Multiple ssh keys are not working

OS Description: Ubuntu 14.04.3 LTS ssh: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3, OpenSSL 1.0.1f 6 Jan 2014 I am unable to use multiple ssh key for gitlab. The error I am getting is GitLab: The project you were looking for could not be found. fatal: Could…
Yogesh Yadav
  • 4,557
  • 6
  • 34
  • 40
15
votes
3 answers

How to use ssh-add to remove identities (pem files) from the agent

I can add pem files to my SSH agent very easily using ssh-add, like so: $ ssh-add /home/jsmith/keys/mytest.pem But I can't seem to remove them: $ ssh-add -d /home/jsmith/keys/mytest.pem Bad key file /home/jsmith/keys/mytest.pem: No such file or…
Dasmowenator
  • 5,505
  • 5
  • 36
  • 50
15
votes
3 answers

SSH agent forwarding to Docker Alpine container from Mac OS

Okay so for several projects I need to access my private repositories, so I'd like to forward the host's SSH Agent to the container to allow retrieving from these private repositories. Eventually I would like to implement this in…
TheWolfNL
  • 1,263
  • 1
  • 13
  • 29
14
votes
3 answers

Unable to point to ssh keys in ~/.ssh on Jenkins host

I've installed SSH Agent Plugin to pull Git repository using SSH authentication. I'd like to use SSH keys located in system file (from the Jenkins master ~/.ssh option). It's screenshot taken from official plugin's page: Unfortunately I don't see…
pmajcher
  • 537
  • 6
  • 14
14
votes
1 answer

How do I use GitHub with SSH without having to run ssh-agent?

In order to push/pull from GitHub using SSH, I have to... $ eval $(ssh-agent -s) $ ssh-add ~/.ssh/git_id_rsa $ git push origin master However, when I push/pull to remote git repositories I host on my own private server, I can skip the whole…
ning
  • 1,823
  • 1
  • 19
  • 25
14
votes
6 answers

sshtunnel doesn't recognize private key password

I'm using sshtunnel to connect to connect to a remote server and on to a database from there. Everything is working fine, except that sshtunnel doesn't seem to recognize my ssh_private_key_password unless I've already entered it elsewhere (or more…
user3092118
  • 351
  • 1
  • 3
  • 10
13
votes
1 answer

ssh-agent forwarding into docker-compose environment is not working

I have been having serious troubles to get ssh-agent forwarded into the docker container (with my docker-compose installation). I have Mac running Catalina, with docker-engine 19.03.8 and Compose @ 1.24. The following is my docker-compose…
MIdhun Krishna
  • 1,739
  • 1
  • 13
  • 31
13
votes
3 answers

ssh-add in docker - Could not open a connection to your authentication agent

I am trying to create a docker image for my Python flask API. I need git to install dependencies and I have already installed git in docker few times. But here, I cannot understand what I'm doing wrong. With the docker: FROM python:3.6-slim ARG…
Laurent GRENIER
  • 612
  • 1
  • 6
  • 13
13
votes
0 answers

cygwin's ssh-add returns "Could not open a connection to your authentication agent."

I have started ssh-agent: $ ssh-agent.exe SSH_AUTH_SOCK=/tmp/ssh-LagrQoD3JRqg/agent.3600; export SSH_AUTH_SOCK; SSH_AGENT_PID=7784; export SSH_AGENT_PID; echo Agent pid 7784; Next I try to add a key: $ ssh-add /cygdrive/h/mykey.pem The response I…
Chris Snow
  • 23,813
  • 35
  • 144
  • 309
12
votes
2 answers

wrong passphrase 3 times: git doesn't ask for passphrase anymore

I wanted to push on a remote git repository. I typed the wrong passphrase three times. I have created a new ssh key and registered the new public key on the repository server. But the ssh agent doesn't prompt for the passphrase. It just keeps…
Sadık
  • 4,249
  • 7
  • 53
  • 89
12
votes
3 answers

SSH IdentitiesOnly=yes forwarding all my keys

I cannot for the life of me figure out why my SSH config is forwarding the wrong key. I have two keys, we'll call them home_rsa and work_rsa. I have done the following: eval `ssh-agent` ssh-add -K ~/.ssh/home_rsa ssh-add -K ~/.ssh/work_rsa Here is…
Marcus McLean
  • 1,306
  • 2
  • 13
  • 24
12
votes
1 answer

Capistrano deployment from Windows using forward_agent option: "Error reading response length from authentication socket."

I'm trying to deploy a project using Capistrano. My development machine is running Windows 7; the server I'm deploying onto is Linux. In the deploy.rb script, the following is set: ssh_options[:forward_agent] = true The Capistrano script starts…
Sam
  • 5,997
  • 5
  • 46
  • 66
1
2
3
23 24