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

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

ssh-agent no longer working

I used to execute eval $(ssh-agent -s) from git bash. It would give me a message and all was fine. Today, it's no longer outputting anything and a ps -ef | grep ssh yields no results. It's like ssh-...
user avatar
  • 1
0 votes
1 answer
25 views

Purpose of adding ssh identity file to ssh agent and keychain

I noticed that the Github instructions for adding an ssh key to your account say that you need to add the key to both your ~/.ssh/config file AND to the ssh agent with ssh-add https://docs.github.com/...
user avatar
  • 161
0 votes
1 answer
123 views

ssh commands in cron jobs on remote server

It is known that cron and ssh-agent do not communicate and hence ssh commands cannot be trivially run under cron. There are solutions involving keychain etc that make it possible to do this. However ...
user avatar
0 votes
1 answer
239 views

ssh-add does not prevent to enter the key's password when using OpenSSH on Windows

I have an RSA SSH key with a passphrase on Windows 11, with OpenSSH. I tried to add it to the agent: C:\code> ssh-add -k C:\Users\user\.ssh\id_rsa Enter passphrase for C:\Users\user\.ssh\id_rsa: ...
user avatar
  • 101
0 votes
0 answers
104 views

Jenkins CLI through SSH with java -jar: What is the configuration to execute the command many times but with the passphrase wrote once?

Having the following: Jenkins (version: 2.303) Ubuntu Desktop (server side) About to use Jenkins CLI from the client side through SSH, in the server side is installed following the plugin: SSH - it ...
user avatar
5 votes
2 answers
4k views

Adding ssh key in WSL permanently

I am relatively new to Linux. Using Ubuntu on WSL2. I added a private key for github with no passphrase using ssh-add. I used it a few times throughout the session but the next day I couldn't connect. ...
user avatar
0 votes
0 answers
21 views

Is it possible to enable PuTTY's "Agent forwarding" after having established an SSH connection (to Linux)?

Using PuTTY to connect to Linux you must enable "agent forwarding" when establishing a connection (via SSH->Auth option). Once an SSH connection is established, that option is not present ...
user avatar
  • 304
0 votes
0 answers
20 views

libssh2 - connecting to agent not working

I am trying to implement Agent Forwarding using libssh2 in iOS/Mac application. I have used same flow as per libssh2 has provided in their example ssh2_agent.c and ssh2_agent_forwarding.c. The issue ...
user avatar
  • 1
0 votes
1 answer
157 views

Can `ssh-agent` somehow interface with Windows' built-in "keychain"-like functionality?

tldr; Does OpenSSH integrate with Windows, so that on unlocking Windows ssh-agent will "unlock" its password-secured private keys? On macOS and in Linux you usually have some kind of ...
user avatar
  • 1,042
1 vote
1 answer
524 views

SSH authentication using gpg-agent and another source for keys?

tl;dr: Is there a way to either disable the persistent import functionality of gpg-agent or work around that to allow using different sources for SSH keys? Situation I use GnuPG 2 keys (on a YubiKey) ...
user avatar
2 votes
0 answers
704 views

How to use Putty with Windows openssh-agent?

I've upgraded my Windows OpenSSH to the latest version (https://github.com/PowerShell/Win32-OpenSSH/releases/) in order to get it accept my RSA key. Now i can add my key e.g. with ssh-add private.key ...
user avatar
  • 21
0 votes
1 answer
782 views

multiple ssh keys in one file with single passphrase

I have multiple ssh keys. Each time I reboot I have to do ssh-add for each of them and type passphrases to unlock each one. Is it possible to store all the in one container file which is added and ...
user avatar
  • 101
1 vote
1 answer
115 views

Prevent SSH key to be automatically added to agent

Is there a way to prevent a certain SSH key to be automatically added to an SSH agent while all others are automatically added? For example, assume all my keys are protected by a passphrase. I would ...
user avatar
  • 111
6 votes
1 answer
193 views

Why SSH always using first key accepted by server?

I have three SSH key pairs that can be found via ssh-add -L; two keys are accepted by the remote server, but only one key can be used for GitHub, and I want to clone a GitHub repository via agent ...
user avatar
  • 163
1 vote
0 answers
22 views

ssh-add not working for some hosts

My ~/.ssh/config: Host github.com HostName github.com IdentityFile ~/.ssh/some_rsa IdentitiesOnly yes Host * IdentityFile ~/.ssh/some_rsa I know that this doesn't make any sense since it's ...
user avatar
  • 111
3 votes
1 answer
544 views

Inserting ssh-agent into i3wm's startup so it's available to all processes in the session

I use the i3wm window manager on Fedora, and the urxvt-mld terminal dæmon for my multipl urxvt-mlc terminal clients. My problem is that I want just one ssh-agent for my entire session, and for the ssh-...
user avatar
  • 193
1 vote
0 answers
95 views

Key caching in SSH forwarding

What I want to achieve is to connect to server A and execute a script that connects to multiple other servers (serially) and perform a task on each. While I can perform that task using ssh -A, the ...
user avatar
  • 111
0 votes
1 answer
818 views

Excuting ssh-agent results in 'mkdtemp: private socket dir: permission denied'

I am unable to ssh from Windows 10 into a Linux machine using key pairs. The following is in the log debug3: unable to connect to pipe \\\\.\\pipe\\openssh-ssh-agent, error: 2 debug1: pubkey_prepare: ...
user avatar
  • 187
0 votes
0 answers
54 views

Adding a key with "ssh-add" works but passing it with "-i" doesn't

I have a case like follows: ssh -J${some-jump-host} -i some-key.pem opc@${some-ip} which does not ask for the key password for some-key.pem but directly fail as it is not authenticated. However, if ...
user avatar
  • 215
1 vote
1 answer
555 views

ssh-agent not persistent after some amount of time (no reboot)

I am using Suse 12 on VM, it is left running and never off/rebooted. I use TCSH and would call > eval 'ssh-agent -c' > ssh-add > <put passphrase here> And then ssh login to servers/...
user avatar
  • 111
1 vote
0 answers
166 views

Windows 10 ssh-agent don't want password after system restart

I've activated ssh-agent service on my Windows 10 machine and set it to start automatically at boot. Next, I've added my ssh keys to agent using ssh-add and during this process ssh-agent asked for ...
user avatar
  • 11
0 votes
0 answers
220 views

ssh-agent forwarding through proxy locks up ssh connection

So I have a weird ssh problem with agent fowarding I'm trying to debug. I have a number of machines inside a firewall I can access via proxy, or directly if I'm connected inside the firewall. ...
user avatar
2 votes
2 answers
2k views

Ssh through bastion host (jump host)

Can somebody give me a one liner ssh command which can connect to remote host through bastion host (jump host). I am not interested in updating ssh config. I have tried below command but didn't work. ...
user avatar
0 votes
0 answers
178 views

SSH key password only asked for once

I have created a public/private key pair and logged into my server with it. I have also copied it to the server under a user. It asked me for the password when logging in the first time but it doesn't ...
user avatar
0 votes
1 answer
63 views

How to avoid neccessity to re-enter password during schell script execution

I am working on a shell script performing recurring tasks of git commit git push mvn release:prepare mvn release:perform in a couple of paths of a JAVA software project. Now each of these commands ...
user avatar
  • 101
0 votes
1 answer
456 views

how to identify the connected client pid/tty from inside tmux

I'm using a long running tmux session on my workstation. Sometimes I have to connect to this workstation by ssh from my laptop. I take my ssh private key stored on a YubiKey with me. Means the Yubikey ...
user avatar
  • 1
0 votes
0 answers
713 views

`Permission denied (publickey)` when key is added to SSH-Agent via Bash script

On both my mobile device and Raspberry Pi (coincidentally AArch and ARM CPUs respectively), ssh-agent is not loaded by default. I first have to start the ssh-agent: eval `ssh-agent -s` I then ...
user avatar
  • 23
1 vote
0 answers
76 views

How to fix my ssh key not being forwarded to a specific server

I have a local host L and two remote servers S0 and S2. I can get ssh keys to be forwarded to S0 but not to S2. What's going wrong? See below for details: L = dev29 S0 = testserver0 S2 = testserver2 ...
user avatar
  • 11
0 votes
1 answer
114 views

ssh-agent keeps asking for password

I am trying to use ssh-agent to not have to type in my password every time I use an SSH key. I am following the instructions / guides but I still am asked every time for the password - how is this ...
user avatar
  • 135
1 vote
0 answers
2k views

Visual Studio Code Remote-SSH Windows 10 ssh-agent.exe issue

I installed the Remote-SSH add-on in VS code. I was able to connect to my server which uses key encrypted login with a passphrase. This included using Windows 10 ssh-agent as described here: https:/...
user avatar
  • 11
3 votes
1 answer
2k views

Why must I use $("ssh-agent") everytime I want to pull/push from a git remote repository?

Each time I want to pull or push to a remote Gitlab repository, it gives me the following error: **> sign_and_send_pubkey: signing failed: agent refused operation Permission denied (publickey). ...
user avatar
  • 31
0 votes
1 answer
218 views

Prompted for key password when key is in ssh-agent

In an old shell session, the number of ssh keys in ssh-agent tends to be large enough to fail authentication with the server, simply because the client just throws keys at it, FIFO fashion. It seems ...
user avatar
  • 440
30 votes
8 answers
154k 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 ...
user avatar
1 vote
0 answers
580 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 ...
user avatar
  • 1,979
0 votes
0 answers
72 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 ...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
  • 111
0 votes
0 answers
156 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 ...
user avatar
  • 101
2 votes
1 answer
675 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-...
user avatar
2 votes
0 answers
513 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 ...
user avatar
  • 1,978
0 votes
2 answers
4k 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 ...
user avatar
3 votes
1 answer
677 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 ...
user avatar
  • 133
2 votes
1 answer
2k 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). ...
user avatar
0 votes
1 answer
420 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 ...
user avatar
  • 101
7 votes
2 answers
17k 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" $...
user avatar
  • 300
2 votes
1 answer
9k 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 ...
user avatar
1 vote
1 answer
1k 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 ...
user avatar
2 votes
1 answer
449 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 ...
user avatar
  • 194
1 vote
1 answer
1k 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 ...
user avatar
  • 113
10 votes
2 answers
14k 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 ...
user avatar
  • 351
1 vote
1 answer
239 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 ~/...
user avatar
  • 4,290