Questions tagged [ssh-agent]
137 questions
187
votes
11 answers
ssh-agent forwarding and sudo to another user
If I have a server A into which I can login with my ssh key and I have the ability to "sudo su - otheruser", I lose key forwarding, because the env variables are removed and the socket is only readable by my original user. Is there a way I can…
Florian Schulze
45
votes
2 answers
Use a specific forwarded key from SSH-agent?
Let's say I have a key for Github, along with other keys. I've added lots of keys to my ssh agent (ssh-add -L returns lots of lines) at my home computer A. In my .ssh/config I have set up which key to use with which host, so e.g.
ssh -T -vvv…
![](../../users/profiles/221948.webp)
danmichaelo
- 552
- 1
- 4
- 8
27
votes
9 answers
SSH: Permission denied (publickey,gssapi-with-mic,password)
====================================================================
UPDATE:
It turned out the configuration of sshd on host2 wont allow password
login. Thanks to people answered…
![](../../users/profiles/217855.webp)
gherkin
- 391
- 1
- 3
- 6
26
votes
6 answers
Can I use PLink and Pageant with Cygwin's ssh?
I'm now using msysgit because of the GUI tools, which use Putty's Pageant and PLink utilities, but I use Cygwin as a general SSH terminal. I had been using ssh-agent on Cygwin, but that means I have to enter my SSH key passphrases for both SSH key…
![](../../users/profiles/1469.webp)
Jerph
- 369
- 1
- 4
- 6
24
votes
9 answers
Running ssh-agent from a shell script
I'm trying to create a shell script that, among other things, starts up ssh-agent and adds a private key to the agent. Example:
#!/bin/bash
# ...
ssh-agent $SHELL
ssh-add /path/to/key
# ...
The problem with this is ssh-agent apparently kicks off…
![](../../users/profiles/89569.webp)
Dan
- 647
- 2
- 8
- 12
16
votes
1 answer
SSH ForwardAgent multiple hops
I've been looking for a solution to the following problem for the past 2 hours with no luck.
Development:
I'm using publickey authentication to connect to my servers. I use ssh-agent forwarding in order to not have to manage public/privates…
![](../../users/profiles/45671.webp)
liquidity
- 408
- 1
- 7
- 22
16
votes
1 answer
How to add SSH key to PuTTY Agent at startup in Windows Server?
I need to add a private SSH key to Putty Agent (pagent.exe) every time a Windows server starts up -- before a user logs on interactively. The key is to be used by a service.
If it was a regular user that needed to use the key, I would just place a…
![](../../users/profiles/104891.webp)
ervingsb
- 385
- 1
- 6
- 16
14
votes
2 answers
In which order does OpenSSH try private keys?
I'm having a hard time finding proper docs on the order in which the OpenSSH client tries private keys for authenticating against a server, given that all of the following are present:
key files with default names in ~/.ssh, e.g. ~/.ssh/id_rsa,
key…
![](../../users/profiles/266138.webp)
sschuberth
- 243
- 2
- 7
13
votes
4 answers
Choose identity from ssh-agent by file name
Problem: I have some 20-30 ssh-agent identities. Most servers refuse authentication with Too many failed authentications, as SSH usually won't let me try 20 different keys to log in.
At the moment, I am specifying the identity file for every host…
![](../../users/profiles/51890.webp)
leoluk
- 511
- 6
- 10
12
votes
1 answer
Accessing SSH_AUTH_SOCK from another non-root user
The Scenario:
I am running ssh-agent on my local PC, and all my servers/clients are setup to forward SSH agent auth. I can hop between all my machines using the ssh-agent on my local PC. That works.
I need to be able to SSH to a machine as myself…
![](../../users/profiles/142599.webp)
Danny F
- 488
- 3
- 10
10
votes
3 answers
SSH key problems: Not a RSA1 key file unknown key type '-----BEGIN'
A backuppc server is able to sign into remote machines as root and backup them up, but if I sign in as the backuppc user and try to ssh into these machines using the same key, the key is rejected with the following debug output:
OpenSSH_5.3p1,…
![](../../users/profiles/233442.webp)
HAL9000
- 139
- 1
- 3
- 8
9
votes
2 answers
How to prioritize explicit ssh key from commandline over ssh-agent keys?
I have a bunch of ssh keys loaded semi-permanently into ssh-agent. ssh-add -L lists 6 keys.
I also have other keys which are stored separately; let's say, on a USB stick. I exactly don't want to keep them handy all the time. Let me call one of them…
![](../../users/profiles/67136.webp)
ulidtko
- 395
- 3
- 12
7
votes
3 answers
Force the use of a gpg-key as an ssh-key for a given server
I configured ssh to use GPG as my ssh-agent and if I remove the ~/.ssh folder, I can ssh into my server fine using my gpg key. However, my ~/.ssh folder has over a dozen different ssh keys in it, and if I try to ssh when it is there, I get a…
![](../../users/profiles/126584.webp)
Mike Dacre
- 288
- 3
- 6
7
votes
1 answer
ssh - retrieve public key from ssh-agent
I am searching for a way to extract the public key from the authentication agent.
I want to be able to write the public key out into a file, after i added the key to the ssh-agent (ssh-add ~/.ssh/id_rsa).
ssh-add -l displays the fingerprint for me,…
![](../../users/profiles/364750.webp)
scones
- 212
- 2
- 11
7
votes
2 answers
ssh server config - input_userauth_request: invalid user
I have a problem configuring my SSH server to be able to log in with public key, without password.
tail -f /var/log/auth.log gives
Feb 6 14:56:06 ubuntu sshd[24654]: rexec line 26: Deprecated option RhostsAuthentication
Feb 6 14:56:28 ubuntu…
![](../../users/profiles/266140.webp)
Philipp
- 171
- 1
- 1
- 2