Questions tagged [ssh-agent]
151 questions
201
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
53
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…
danmichaelo
- 632
28
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…
gherkin
- 401
28
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…
Dan
- 717
27
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…
Jerph
- 379
16
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…
sschuberth
- 263
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…
liquidity
- 418
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…
ervingsb
- 385
16
votes
3 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…
ulidtko
- 497
15
votes
1 answer
Pass password in ssh config
Is there any way to pass a password using .ssh/config? I'm trying to set up a way to login to a server under a specific user and then switch automatically to root when I connect (need to input password).
For now, I have:
Host server
HostName…
cduma
- 151
- 1
- 1
- 3
14
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,…
scones
- 292
14
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…
Danny F
- 508
14
votes
5 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…
leoluk
- 551
11
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,…
HAL9000
- 149
10
votes
4 answers
SSH Agent forwarding not working on Ubuntu 22.04
I am trying to connect to github over ssh on my remote server (Running Ubuntu 22.04).
On my local computer (Running Win 10), I have ~/.ssh/config file with the following:
Host remote
HostName SERVER_IP
port 22
User ubuntu
…
mr.d
- 243