Skip to main content

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
98 votes
2 answers
178k views

How do I clear out the ssh-agent entries (on Mac OS X )?

I'm running Mac OS X, and it appears that after SSHing to several machines, using identity files, my 'ssh-agent' builds up a lot of identity / keys and then sometimes offers too many to a ...
cwd's user avatar
  • 18.2k
84 votes
4 answers
68k views

How to make ssh-agent automatically add the key on demand?

I want to run ssh-agent (with maximum lifetime option), but not add any keys at startup, but instead add them on demand. Like first time I login to some server it should ask for passphrase, next time ...
Vi.'s user avatar
  • 17.3k
80 votes
20 answers
61k views

Sharing the same `ssh-agent` among multiple login sessions

Is there a convenient way to ensure that all logins from a given user (ie me) use the same ssh-agent? I hacked out a script to make this work most of the time, but I suspected all along that there ...
intuited's user avatar
  • 3,391
57 votes
13 answers
22k views

How do you get screen to automatically connect to the current ssh-agent when re-attaching to an existing screen?

If you start a screen session while ssh-agent is running (from ssh -A agent forwarding), accessing ssh-agent works fine. However, if you detach from that session, log out, log in again (with ssh-agent ...
user avatar
40 votes
6 answers
20k views

How can I forward a gpg key via ssh-agent?

I can use the ssh configuration file to enable the forwarding of ssh keys added to ssh-agent. How can I do the same with gpg keys?
txwikinger's user avatar
  • 2,677
40 votes
2 answers
38k 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 ...
timotree's user avatar
  • 1,118
35 votes
9 answers
176k 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 ...
FlorianLudwig's user avatar
27 votes
3 answers
26k views

Use a specified key from ssh-agent

Along the lines of How to tell git which private key to use? I would like to use a specific ssh key in a given situation. My problem is that even when I specify '-i something' ssh uses the keys from ...
svrist's user avatar
  • 815
24 votes
1 answer
10k views

Using the IdentityFile directive in ssh_config when AgentForwarding is in use

Is it possible to specify forwarded keys using the IdentityFile directive in .ssh/config? I ran into this quirk when trying to deploy some code via Capistrano/GIT on our production server. Both my ...
skryl's user avatar
  • 385
23 votes
2 answers
50k views

Extra configuration required for ssh-agent forwarding?

This guide does a great job explaining how ssh-agent works across multiple systems. I'd like to get forwarding set up as it is in the last set of diagrams, but I'm having trouble tracking down the ...
Coderer's user avatar
  • 1,620
23 votes
7 answers
42k views

How to use SSH private key to log in without entering passphrase every time on Mac OS X Lion?

I use Mac OS X Lion and login remote hosts via SSH every day. Despite the fact that I use SSH key pair for remote authentication and I don't need to motorize every host's login phrase, it is still ...
Jianwen W.'s user avatar
22 votes
3 answers
36k views

ssh-agent / ssh-add error: could not open a connection to your authentication agent

I type in ssh-agent and get the following back: SSH_AUTH_SOCK=/tmp/ssh-GqdeT074HLRJ/agent.4670; export SSH_AUTH_SOCK; SSH_AGENT_ID=4671; export SSH_AGENT_PID; echo Agent pid 4671; I then type in ssh-...
neubert's user avatar
  • 7,204
20 votes
1 answer
12k views

Silence ssh-add

I have a cronjob that runs some tasks, and at the beginning of the script it runs is an ssh-add call ( it doesn't run as the user with the appropriate key so it needs adding, and in future it may well ...
Tom J Nowell's user avatar
20 votes
2 answers
19k views

Can't remove keys from ssh-agent. Even rebooting doesn't help

A short time ago I noticed that there were three keys in my ssh-agent that I could not delete. ssh-add -l showed three keys; I ran ssh-add -D, and was told "All identities removed."; but then an ...
Sean's user avatar
  • 1,794
18 votes
7 answers
16k views

How can I get ssh-agent working over ssh and in tmux (on OS X)?

I have a private key set up for my github account, the passphrase to which is, I believe, stored in OS X's keychain. I certainly don't have to type it in when I open a terminal window and enter ssh ...
Rich's user avatar
  • 2,300
17 votes
3 answers
21k views

Why do I have to keep unlocking my SSH key?

I ran some X applications using ssh -Y my_address and now it asks me to unlock my RSA key every time I use it. I used to only have to unlock it once a day. What's going on? I'm using Ubuntu 9.04.
Benjamin Oakes's user avatar
16 votes
7 answers
46k views

Filezilla on Mac: SFTP with passwordless authentication?

I am trying to follow the instructions here for OSX http://wiki.filezilla-project.org/Howto I can successfully ssh to the target server with no username/password (OSX picks up my certificates from ...
Dan Rosenstark's user avatar
16 votes
5 answers
16k 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 ...
Niks's user avatar
  • 811
15 votes
2 answers
4k views

How, if at all, do SSH keys differ from asymmetric keys used for other purposes?

How, if at all, do SSH keys differ from asymmetric keys used for other purposes, e.g. email signing? I'm prompted to ask this, in part, because on OS X, there are apps available to manage SSH keys (...
user avatar
14 votes
1 answer
46k 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 ...
Niks's user avatar
  • 811
13 votes
3 answers
18k 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/...
xpt's user avatar
  • 8,821
12 votes
2 answers
16k 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. ...
ahmedsabriz's user avatar
12 votes
2 answers
18k 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 ...
shillner's user avatar
  • 381
11 votes
1 answer
33k views

ssh-agent on MAC OS X Lion - sometimes it requests ssh password

Terminal V. 2.2.2 Mac OS X Lion 10.7.3 I've followed ipsis verbis the steps here: https://superuser.com/a/8110/72002 This works, BUT, if I restart the machine, it promps for the password again!!! ...
MEM's user avatar
  • 1,337
10 votes
3 answers
26k views

How to change the number of columns on a putty window to more than the screen width?

I am on windows and often have to ssh to linux machines. Though as much as I would love to have an alternate ssh client, none really comes part to Putty. One thing or the other always breaks, even in ...
Saad Rehman Shah's user avatar
9 votes
6 answers
5k views

ssh-agent and screen

A while back on StackOverflow, I asked this question about ssh-agent and crontab. I have a similar question now about ssh-agent and screen on linux systems. So, on my Mac, ssh-agent launches at ...
Michael H.'s user avatar
9 votes
2 answers
3k views

ssh-agent key timeout with screen or tmux on bastion host

Normally I have ssh-agent running, I ssh to my bastion host then open a tmux session and connect to other boxes through that. Key forwarding works for any sessions that I open from that point forward....
Jericon's user avatar
  • 191
8 votes
2 answers
5k views

Agent Forwarding Through Different Usernames (Git & Deployment)

This query isn't directly related to Git, but since one of Git's supported transports is SSH, and I'm trying to use agent-forwarding, I thought I would ask for clarification (the man pages have let me ...
Lee Hambley's user avatar
8 votes
2 answers
1k views

How to stick ssh-agent locking to the windows login?

Is it somehow possible to automatically unlock my private keys forr ssh authentication at windows login and (un)lock them when (un)locking my session? Currently I'm using msys' ssh-agent but could ...
Tobias Kienzler's user avatar
7 votes
3 answers
23k 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" $...
Nate's user avatar
  • 299
7 votes
3 answers
13k views

How can I retrieve my ssh passphrase from gnome-keyring?

I forgot the passphrase for my ssh private key, but it's still stored in gnome-keyring, so it seems to me that I should be able to recover it. Seahorse lets me recover web site passwords from my ...
ʇsәɹoɈ's user avatar
6 votes
4 answers
10k views

Remove Mac OS X SSH Passphrase Pop-Up

The ssh-agent on my Mac causes a pop-up for certain hosts: [me@my-laptop]$ ssh cargo2 Last login: Tue Aug 3 09:26:43 2010 from trainwreck.arlut.utexas.edu [me@cargo2]$ But for other hosts: [me@my-...
aaron's user avatar
  • 543
6 votes
1 answer
514 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 ...
shvv's user avatar
  • 163
6 votes
1 answer
1k views

Is it possible to have zsh+keychain+tmux not ask for keys?

I'm using tmux and zsh, and I've recently been learning about ssh-agent and keychain. From the manpage for zsh, it says that it will source .zlogin only if the shell is, well, a login shell. ...
Wayne Werner's user avatar
  • 2,373
5 votes
2 answers
4k views

tmux: Cannot SSH from inside tmux, even though I have agent-forwarding (ssh -A) on [duplicate]

So I have keys to some servers stored locally on my MacBook, but I work from inside a Virtual Machine a considerable amount of time, so I SSH to the VM with ssh -A. This allows me to SSH to servers ...
d11wtq's user avatar
  • 161
5 votes
3 answers
10k views

Git -- SSH Agent not working

The back story -- I've been using Git on this computer (Windows XP) for about 8 months with no problem. Suddenly, last week, it is no longer asking me for my username and password when I start Git up. ...
Kerry Jones's user avatar
5 votes
1 answer
14k views

Delete key from ssh-agent on Mac OS X 10.6

I'm trying to find a way to delete a single ssh identity from my Mac's ssh-agent, the ssh-add man page states the -d option does Instead of adding identities, removes identities from the agent. If ...
Rwky's user avatar
  • 688
5 votes
1 answer
2k 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 ...
rdm's user avatar
  • 153
5 votes
1 answer
6k 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 ...
shulard's user avatar
  • 153
5 votes
3 answers
1k views

Is it possible to spawn an ssh-agent for a new tmux session?

I've seen lots of hacks for re-establishing contact with a GUI session's SSH agent from within tmux (and screen) sessions. I'm wondering if it's possible to de-couple from the GUI and spawn an ssh-...
stsquad's user avatar
  • 499
5 votes
1 answer
1k 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="@{...
Be Kind To New Users's user avatar
5 votes
0 answers
1k views

gpg-agent asks for ssh password, although the private key has no password set

I am using gpg-agent to manage my github ssh key. I generate my (private) ssh key via openpgpg2ssh from my private gpg key. Unfortunately, although my private gpg key is not password protected, gpg-...
ILikeGit's user avatar
4 votes
3 answers
10k views

How to automate starting the ssh agent and adding my key(s) in WSL2 for Windows 11

OS: Windows 11 Version 10.0.22621 Build 22621 WSL version: 1.2.5.0 (WSL 2) Linux distro: Ubuntu 22.04.2 LTS I run WSL2 on Windows 11 in a Windows Terminal window, and I often connect to a remote ...
DeltaIV's user avatar
  • 437
4 votes
1 answer
2k 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-...
RoUS's user avatar
  • 203
4 votes
3 answers
17k 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 ...
askewchan's user avatar
  • 171
4 votes
1 answer
4k 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 ...
hyiltiz's user avatar
  • 478
4 votes
1 answer
1k views

Can I make ssh-agent wait until I use ssh to prompt for a password?

I have ssh-agent set up to automatically start and prompt when I open a terminal window, as is explained here. It gets somewhat annoying though since many times when I open a shell I don't plan on ...
Clueless's user avatar
  • 359
4 votes
2 answers
6k views

openssh in Windows 7, run ssh-add once for all cmd instances

I have installed openSSH as part of the latest cygwin distribution. My goal is to use the ssh-agent from native window console (cmd) in order to login passwordless in a various number of Linux ...
nonouco's user avatar
  • 183
4 votes
1 answer
2k 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, ...
Nathan Basanese's user avatar
4 votes
3 answers
800 views

Windows11 ssh-agent does not remember passphrase

I am facing the issue that my running ssh-agent is not remembering my private key passphrase. It keeps prompting to enter it, each time I open an SSH session. I cannot figure out why and hope somebody ...
straumli's user avatar