Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ssh-agent]

SSH-agent is an utility which offers a secure way of storing the passphrase of the private key used in SSH connections

2
votes
1answer
867 views

ssh: Error loading key “./id_rsa”: invalid format

For some reason one of my ssh keys "just broke" - it just stopped working: $ ssh-add ./id_rsa Error loading key "./id_rsa": invalid format Copying the key inside a clean VM, the key does work. Even ...
0
votes
0answers
166 views

Could not open a connection to your authentication agent. Agent is running, has keys, and is forwarded

My configuration for accessing parts of my cloud have seemingly failed, and I can not seem to understand what is going wrong. My SSH agent is running, my private key has been added, and I've ...
0
votes
0answers
17 views

Avoid using remote identity file when using ssh on remote server [duplicate]

I'm connected to serverA with SSH. I have one identity file on my local computer, which I use to authenticate to serverA, and one identity file on serverA which I use when I'm at that computer ...
1
vote
1answer
245 views

SSH login hangs in MacOS Sierra but not in Linux environment

The command below hangs when I attempt to connect to SSH server from Mac OS client. However, it works perfectly fine in Linux env. $ ssh -vvv master@172.18.0.2 -p 22 OpenSSH_7.4p1, LibreSSL 2.5.0 ...
0
votes
0answers
46 views

Have gpg-agent start with ssh key file when available, falling back to gpg keys?

On linux (Fedora) using bash, I have setup the GnuPG gpg-agent to act as the ssh-agent successfully. When authenticating over ssh, the agent tries the gpg keys first then falls back to the ssh keyfile ...
2
votes
1answer
267 views

ssh-agent rendered unusable after single use

I'm using Ubuntu 18.04 on WSL (Windows 10 1803, Build 17134.112), and lately I've noticed an issue with ssh-agent. When I start up a shell, before connecting to anything over SSH, I first call ssh-...
2
votes
0answers
195 views

Globally set environment variables for gpg-agent in MacOS High Sierra

I want to use gpg-agent instead of ssh-agent in MacOS High Sierra. To achieve this I need to set globally two environment variables: GPG_TTY=$(tty) SSH_AUTH_SOCK=${HOME}/.gnupg/S.gpg-agent.ssh This ...
0
votes
0answers
133 views

Git for Windows looks for SSH key in Unix-style path

I've been reinstalling my laptop from scratch and have some trouble with Git for Windows this time. I've recreated my usual setup on Windows 10 with PowerShell, posh-git and ssh-agent. However, Git ...
0
votes
1answer
502 views

How to automatically close the ssh-agent along with closing Cygwin?

I am on Windows 10 Pro. I have added the following lines to my Cygwin (fully up-to-date) ~/.bashrc file: eval $(ssh-agent) > /dev/null ssh-add > /dev/null 2>&1 in order for me not to ...
0
votes
1answer
55 views

How do I get ssh to use only one key from ssh-agent?

I need to use two different ssh keys when connecting to the same host. The machine I need to use to connect (because of ip address restrictions) is not the machine where the ssh keys are stored, so I ...
0
votes
1answer
300 views

Predefine unix socket path for ssh-agent

I have an application which creates an x-session, the problem I'm having is with ssh-agent. Lets say I have created a unix socket, and then create x-session(in this session ssh-agent is launched). ...
0
votes
1answer
116 views

ssh-agent only works as command and not in a script in macOS

I have a Mac with macOS 10.11.6 and had the problem that when I connect through ssh to a server the password (for the private key) was not saved, I had to type it each login. So I found this solution ...
1
vote
2answers
1k views

ssh-agent reset in Windows Subsystem for linux (WSL)

I am trying to use ssh-agent under WSL but the SSH params are wiped after the script is run From .bashrc (cut down version) eval $(ssh-agent) ssh-add ssh-add -l echo "SSH_AGENT_PID is" $...
1
vote
1answer
3k views

Windows 10 Linux subsystem ssh-agent not persisting added identities

I have started using my Windows 10 for Rails development and am using Linux subsystem for the same. Recently I faced an issue connecting to a remote machine via SSH from the terminal. The public key ...
1
vote
1answer
475 views

PHP shell_exec ssh-add ssh-agent could not open connection to authentication agent

I did this shell_exec('eval "$(ssh-agent -s)" 2>&1'); shell_exec('ssh-add /opt/.ssh/id_rsa 2>&1'); and still getting error connecting to authentication agent. The first line ...
2
votes
1answer
289 views

ssh not using agent-forwarded keys

I ssh from local to X, and I would like to ssh from X to Y using password-protected RSA keys, with all my private keys being stored on local. However, local> ssh -A X X> ssh Y Received ...
1
vote
1answer
636 views

Installing SSH private key on FreeNAS for outgoing SSH/rsync

I am attempting to establish an outgoing SSH session from my FreeNAS to my web server. My hosting service requires RSA keys for SSH access. I have generated keys with ssh-keygen -t rsa, and have ...
5
votes
2answers
6k views

SSH Agent Setup on Windows with cygwin

I've created this question just as a reminder for me since I usually do the setup of an SSH agent only once every few years. So, how can one setup an SSH agent under Windows, assuming the usage of a ...
1
vote
1answer
101 views

Unlocking private SSH key (with Cygwin/X11) when there is no local shell involved?

I have installed Cygwin/X11, including openssh. I have set up a public / private key pair. I have installed the public key in ~/.ssh/authorized_keys of RemoteHost. I have configured Cygwin/X11 (via ~/...
8
votes
2answers
4k views

Save identities added by ssh-add so they persist

I recently setup openssh so I could use it with git. In the process of setting it up (as per this article) I ran the commands: $ eval "$(ssh-agent -s)" $ ssh-add ~/.ssh/<name of key> Some ...
0
votes
1answer
129 views

ssh-agent never forgets private keys

When using ssh with an encrypted private key for authentication, I never have to enter the passphrase (except probably once, can't remember). I noticed I'm running ssh-agent - which I don't remember ...
4
votes
1answer
2k views

ssh-agent service stop starting at login on Mac OS 10.11

I'm currently facing a little issue about the ssh-agent service. I rebooted my computer today after removing a Boot Camp partition. Since then, ssh-agent no longer starts automatically at login. I ...
0
votes
1answer
55 views

How can I make SSH only use keys provided by ssh-agent?

I need ssh to only use keys provided by ssh-agent, and ignore any identity files in ~/.ssh. What's the best way to do that? Background: I need to authenticate against a Git server via SSH. I have a ~/...
1
vote
1answer
551 views

Keeping ssh-agent running after closing the console

I'm using cmder (ConEmu) as my terminal. My default shell is zsh. I've tried the ssh-agent plugin for zsh, I've tried keychain and I've tried starting ssh-agent manually. No matter what I do, the ssh-...
1
vote
0answers
308 views

SSH Key only working with ssh agent

I just created a set of SSH keys and used ssh-copy-id to copy it on to a remote server. Upon trying to connect via ssh I got the error sign_and_send_pubkey: signing failed: agent refused ...
0
votes
1answer
204 views

SSH-Key does not get unlocked even with ssh-add

I'm very confused. Every manual I read the last 15 minutes tells me this should work but it does not: $ ssh-agent -s SSH_AUTH_SOCK=/tmp/ssh-syXn9Tk09V9P/agent.16332; export SSH_AUTH_SOCK; ...
1
vote
1answer
704 views

SSH multi-hop via config file

I would like to login to a remote server by executing sth. like ssh remoteServer. The remote server can only be reached via a login server (which there are two of). There are two routes I would like ...
1
vote
1answer
37 views

Using the key of a computer that I connected to via SSH?

I currently have a system where I'm using a desktop to connect to a gateway and then to multiple servers from there. The ssh key of my desktop is in the gateway and the other servers, and I'm running ...
3
votes
1answer
5k views

SSH - is this the correct way to forward agent?

I have checked many results but not getting exactly that what I am doing for agent forwarding is correct or not. Please advice. I have followed this two links Github unixwiz What I am doing is: ...
0
votes
2answers
2k views

Yet another “ssh agent forwarding not working”

I can ssh from hostA to hostB and from hostA to hostC using keys loaded into ssh-agent without any problems. However, if I do ssh -A hostB from hostA, then try ssh hostC from hostB, public key ...
-1
votes
1answer
162 views

SSH ForwardAgent access to github isn't working

I am working in a team with two other guys. We all have access to a server with our personal SSH keys and we can directly login to the server. We are using ForwardAgent, more specifically all three of ...
1
vote
1answer
272 views

Make SSH_AUTH_SOCK be the same file every time

I need to be able to make ssh-agent use the same file for it's socket every time I log in. Currently it uses a random file in a temp folder, and this is causing issues for a systemd service in vagrant....
3
votes
1answer
618 views

How do I undo an ssh-add on a forwarded identity to access github?

I'm currently trying to access GitHub to clone a repository with SSH. However, when I enter the url to clone, the server hangs after Initialized empty Git repository in /export/home/nathan/myrepo, ...
2
votes
1answer
2k views

ssh-agent running with i3wm keeps promting for password at each git push

I have installed Debian testing with i3wm, using SDDM (Simple Desktop Display Manager) to start it. In the i3 workspace, I could find the ssh-agent process already started. However, I still am being ...
2
votes
1answer
890 views

su - Automatically unlock ssh key

On Linux there exists a tool - I believe it is ssh-agent - that can automatically unlock one's ssh key, so that when using git to fetch from a remote repository it will automatically use ones unlocked ...
1
vote
2answers
15k views

Running the output of `ssh-agent` in fish; what does `setenv` do?

When I want to start (or restart) ssh-agent, it gives me a few commands that I should run by doing eval $(ssh-agent). Of course this fails for fish, since it gives syntax for bash or csh. The ...
2
votes
1answer
351 views

libssh2 - Agent Forwarding not working

I am using libssh2 library to ssh connections in my mobile application. Here I want to use Agent Forwarding support. I have followed same procedure as they have provided in example here LibSSH2 Agent ...
10
votes
3answers
4k views

SSH Agent loses identity while restart machine

After creating keys with name id_rsa at it's default location. I am adding identity to SSH agent with command ssh-add ~/.ssh/id_rsa, It's adding successfully. I can SSH without entering pass phrase ...
0
votes
2answers
245 views

force SSH (on client) to ask for password (Xubuntu)

Please, how do I configure the SSH-asking-password politics? I am using hibernate a lot on my laptop. The problem is that when I resume and make a SSH connection which I had already done in the ...
8
votes
1answer
20k views

How to do SSH agent forwarding on Mac terminal?

I have checked many tutorials regarding this but not getting clearly. As per tuts, there are two way to configure for agent forwarding in your config file ~/.ssh/config set Host example.com ...
0
votes
1answer
107 views

ssh-agent fails to remember password

ssh me@server eval $(ssh-agent); set | grep SSH_A SSH_AGENT_PID=19216 SSH_AUTH_SOCK=/tmp/ssh-CYiyq19215/agent.19215 ssh-add Enter passphrase for /home/me/.ssh/id_rsa: Identity added: /home/me/....
1
vote
0answers
243 views

SSH agent forwarding is not working

My SSH agent forwarding is not working. The answer from this question is quite old and the answer is conflicting with the comments. Can we have an updated answer please? Basically I can SSH from ...
2
votes
0answers
220 views

ssh-agent installed with git 1.9.5 faults

I am getting a fault when running ssh-agent from windows 7. I think it could be a permission issue, though UAC is off. ssh-agent.exe SSH_AUTH_SOCK=/tmp/ssh-vDq8tk2Qlatv/agent.10256; export ...
1
vote
0answers
368 views

Usage of ssh-agent with signed SSH keys

My ssh-agent doesn't want to store my credentials for Signed SSH key when connecting to a SSH server that use a SSH CA. I mean, each time i try to logon it ask me for the passphrase of the certified ...
1
vote
1answer
63 views

ssh-add -D deletes keys on originating host

I have an ssh-agent running on my macbook. I use ssh -A and carry the keys forward to my redhat box. The thing that surprises me though is that when I do a 'ssh-add -D' on the redhat box, the keys ...
5
votes
1answer
724 views

ant <scp> support for ssh-agent

I have an existing build.properties file that uses scp like this: <scp todir="${linux.user}@${linux.site}:@{todir}" keyfile="${ssh.keyfile}" passphrase="${ssh.passphrase}" trust="yes" verbose="@{...
4
votes
1answer
2k views

SSH Agent Forwarding not working even when using `ssh -A`

First of all, I've checked all the following Agent Forwarding not working Extra configuration required for ssh-agent forwarding? SSH Agent Forwarding Not Working https://serverfault.com/questions/...
3
votes
1answer
821 views

Use private keys only from ssh-agent, avoiding “Too many authentication failures”

I store all my private keys encrypted in encfs file. I mount (decrypt) encfs file to folder, add all private keys to ssh-agent with a lifetime flag and unmount folder. In this case my private key ...
1
vote
1answer
612 views

ssh agent forwarding failing at 6 keys

My client is mac os x 10.9.5. I have a bastion host (linux) that I am ssh'ng into. I have agent forwarding working so I can ssh to the bastion host and then ssh into another machine without having ...
0
votes
0answers
274 views

ssh-agent/ssh-add - how can I force confirmation by default?

I use ssh forwarding alot and I'm concerned about "agent hijacking", so, I like to use -c option when calling ssh-add, which enforces confirmation on every key usage. How can I turn the confirmations ...