Stack Exchange Network

Stack Exchange network consists of 175 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 a single sign-on mechanism for SSH that is included in the OpenSSH software. Use this tag for questions on how to configure and use ssh-agent.

0
votes
0answers
20 views

SSH server accepts key, but signing fails

I have recently tried migrating from a standard ssh public key setup to managing my keys with GPG. Following instructions on my distribution's wiki, I set up ssh to use gpg-agent instead of the ...
0
votes
2answers
30 views

How to restart ssh-agent without relogin

I accidentally killed my ssh-agent, how do I restart it without having to reconnect ? I tried this but it does not work : $ eval $(ssh-agent -s) Agent pid 8055 Then, I open a new Gnome terminal ...
0
votes
0answers
21 views

ssh config with ProxyCommand, need to enter passphrase for ssh key on intermediate server

So in this case, we have 3 machines, A (me), B (intermediate), and C (goal). I can ssh from A -> B no problem. B -> C also works, but the key on B is protected by a passphrase. I want to have an ...
1
vote
0answers
36 views

Debian 9 - sign_and_send_pubkey

I decided to start switching my machines over from Ubuntu to pure Debian but I'm currently stuck at a hurdle with configuring my git repositories related to ssh. I created a new key and added it to ...
2
votes
1answer
91 views

Adding SSH keys to ssh-agent on demand

Instead of invoking ssh-add to add every key to ssh-agent, is it possible to add those keys automatically as soon as they are asked by ssh? Likewise agents launched by desktop environments do? EDIT: ...
0
votes
1answer
75 views

How do I use ssh-agent as a wrapper program?

I'm trying to start awesome windows manager as a subprocess of ssh-agent. It worked when I used startx (ssh-agent startx). But now I'm trying to make it work under lightdm. lightdm starts /usr/bin/...
0
votes
1answer
74 views

alternatives to SSH_AUTH_SOCK for the command line

Are there alternatives to the SSH_AUTH_SOCK environment variable for passing agent info to ssh? What I'm looking for is something like -o SshAuthSockPath="/path/to/socket" but nothing like that ...
0
votes
0answers
118 views

How to start a systemd service running in an ssh-agent?

The answer to How to start and use ssh-agent as systemd service? gets us a running ssh-agent. How can you write another systemd service file so that its process runs under that ssh-agent? In ...
0
votes
1answer
78 views

Weird behavior of SSH, not using proper key comment

I am using Ubuntu 18.04 LTS. Whenever, I ssh-copy-id for the first time it puts my username@host at the end of the authorized_keys file line as expected. On Remote machine: sacredos@sacredos-DT:~$ ...
0
votes
1answer
127 views

Connecting to SSH authentication agent when running commands with sudo

I use etckeeper to keep my various OS configurations under version control. Until now, I was content to just use a local Git repository to keep track of changes but it occurred to me that I wasn’t ...
0
votes
1answer
52 views

How to go back to entering the ssh key password in the terminal

When I upgraded Ubuntu 16.04 to 18.04, one of the changes was that the password prompt to unlock my ssh key (from the agent) now is in a little GUI popup instead of at the terminal prompt. This is ...
0
votes
0answers
48 views

Ubuntu 16.04 - ssh-related commands open a GUI window to ask me for my SSH key password

Whenever I use commands like ssh user@server on the command line, I am not asked directly in the command line for my ssh key password, but in a new window (GUI). However, if I execute eval $(ssh-agent)...
0
votes
1answer
102 views

Repeated prompts for SSH private key password in single session

I have a private SSH key on a shared development server, which is secured with a password. Even after loading it into ssh-agent, I get re-prompted for the private key password For some reason, even ...
0
votes
1answer
731 views

How to automatically run “ssh-agent bash” and “ssh-add” when log in? [duplicate]

I have a scenario where, whenever a user logs into a CENTOS machine via SSH, I need to have the following commands run: ssh-agent bash ssh-add [This other thread explains why I am using those ...
3
votes
1answer
517 views

How can I suppress host key checking with ssh-agent

I have a script with this snippet: ssh-agent bash -c "ssh-add $SOME_KEY; \ git submodule update --init foo" The script hangs while asking the user: RSA key fingerprint is ...
0
votes
1answer
40 views

ssh-agent for nested tmux session

sessionA sessionB I start tmux in first window of sessionA but using this command to wake it: ssh-agent tmux that I expect new nested sessionB will have its own ssh-agent listen for it. And ...
0
votes
1answer
26 views

OpenSSH prompts for password for `~/.ssh/id_rsa` which is already in ssh-agent

When I attempt to SSH to a host, ssh still prompts for the password of the ~/.ssh/id_rsa key (Which was generated and exported from PuTTYgen), even though the password is already loaded in ssh-agent (...
10
votes
3answers
10k views

ssh-add returns with: “Error connecting to agent: No such file or directory”

ssh-add alone is not working: Error connecting to agent: No such file or directory How should I use that tool?
0
votes
0answers
139 views

How to ssh-add elliptic curve key?

I'm trying to use a newly generated elliptic curve key with git version control for GitLab. I am using a Xubuntu 16.04. My OpenSSH version is: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g 1 Mar ...
0
votes
0answers
164 views

Agent forwarding and `sudo` vs `sudo -i`

Under an ssh -X -A localhost session, sudo xeyes opens the eyes but sudo -i xeyes does not. ~$ sudo -i xeyes X11 connection rejected because of wrong authentication. What extra step is needed in ...
0
votes
0answers
48 views

Agent forwarding and `sudo` vs `sudo -i` [duplicate]

Under an ssh -X -A localhost session, sudo xeyes opens the eyes but sudo -i xeyes does not. ~$ sudo -i xeyes X11 connection rejected because of wrong authentication. What extra step is needed in ...
0
votes
0answers
93 views

ssh-add: add_file: key_cert_copy: invalid argument

I get this error when running ssh-add. The command seems to work after this, but the return code is 127 (so a script runs into an error at this point). Does anyone recognize the error? Google doesn't ...
4
votes
0answers
983 views

Could not add card - Agent refused operation

I am on Ubuntu 16.04 and trying to add the certs on my CAC card using the ssh-add commands with no luck. ssh-add -s /usr/local/lib/opensc-pkcs11.so Enter passphrase for PKCS#11: Could not add card "/...
5
votes
2answers
283 views

Why would pgrep not show my processes but sudo pgrep does?

I looked at a list of processes and filtered out ssh-agent which correctly shows the 3 processes I expected: $ ps -ef | grep ssh-agent belmin 1051 1 0 16:05 ? 00:00:00 ssh-agent -a /...
1
vote
1answer
505 views

Use my already running ssh-agent process

I have a bash session on tty2 and an ssh-agent process belonging to me (same user id) from a previous session (TTY = ?) On tty2, ssh-add says : Could not open a connection to your authentication ...
2
votes
0answers
254 views

How is my ssh key unlocked without ssh-agent? And how do I fix that?

I have an SSH key that I use almost every day and I recently noticed that I haven't had to unlock it in a long while. I don't always shut down my computer and so it is fairly common that ssh-agent is ...
9
votes
1answer
967 views

Who is starting my ssh-agent, and why won't it properly terminate?

This is a problem I've been having for a long time, but every time I try to figure something out I get lost, so I figured I'd better ask here where maybe someone more experienced could help me. ...
1
vote
2answers
100 views

Is it a security risk to let ssh-agent always use the same socket?

I use ssh-agent as a wrapper program for startx. Is it a security risk, to use always the same socket file? ssh-agent -a /tmp/xyz123 startx -a specifies the socket bind address. If not specified, it ...
0
votes
1answer
340 views

I want to gather the host keys but ssh-keyscan command is not found on my linux. Anyway to achieve the same with some other commands

I want to gather the host keys but ssh-keyscan command is not found on my linux. Anyway to achieve the same with some other commands without adding this command explicitly. I am running with Wind ...
0
votes
1answer
98 views

What is the default number of login attempts before login fail

When I connect to a remote machine using ssh, my ssh agent will try all key files available in .ssh. Per default, how many key files can the agent try for the log-in until server sends permission ...
5
votes
2answers
345 views

share ssh session/key with remote user

Assume the following setup: User bob is working locally on his workstation foo. User alice is working locally on her workstation bar. User bob has ssh access to server baz:22 via a key stored at bob@...
1
vote
1answer
442 views

Loading OpenSSH certificate into ssh-agent without the private key

I'm storing my ssh keys on a yubikey and hence I don't have any private key file on disk. This gives me a problem when I'm also using OpenSSH Certificates to authenticate. If I would like to bring the ...
1
vote
0answers
1k views

ssh stuck after showing local version

I am trying to ssh to a different system from my Ubuntu, but it got stuck after this log root@akash:~# ssh -vvv root@192.168.2.219 OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g 1 Mar 2016 debug1: ...
1
vote
1answer
50 views

ssh server : control ssh-key protection with password

On a server with strong access control, is it possible to ensure that all allowed key have a password protection. is there a way to deny access to some key if they are no protected by password. I don'...
0
votes
1answer
115 views

Server rebooted, but client's old/stale SSH connection is still active

So I'm working on a little SSH call back solution for one of my boxes, and I'm having a slight problem that I barely know what to even look up to figure out what's going on. Basically, the client ...
2
votes
1answer
1k views

How to ssh-add a SSH key without recreating a new instance of SSH agent?

I add the following in my .bashrc ssh-add ~/.ssh/id_rsa so when I open a new tab in my shell/terminal app (iTerm2 on macOS), it automatically add the SSH identity using the SSH agent and I don't ...
1
vote
1answer
272 views

Keychain ssh-agent overriding specified SSH key

I use GitLab repositories with two users (myself and a test user). For my test repository I have this in .git/config: [core] sshCommand = ssh -i /test-project/test_id_rsa [remote "origin"] ...
0
votes
1answer
74 views

Does providing username once cause `ssh` to suddenly not asking for password anymore? [closed]

For a long time, I was baffled by why ssh command was asking for a password sometimes, and sometimes not. Even when I was using the same private/public key pair on many different clusters, I was ...
1
vote
2answers
69 views

Create ssh key pairs to copy elsewhere without messing up my personal ssh setup

In my Mac I already have a personal RSA key pair under ~/.ssh I would like to create a couple of RSA keys in my Mac but for another computer. So I don't want to run some ssh command and replace my ...
1
vote
0answers
45 views

Save IP in remote host every time connection is up (as non-root-user)

I have a dynamic local Lan IP at work (temporarily), but in order to connect from home, I ssh to the host A (static IP) and from there to my machine. However, since the IP changes, I would like to ...
2
votes
1answer
588 views

What is the best way to share the SSH authentication socket with another user?

I'm using Ansible for setting up a remote server and I'm using SSH agent forwarding to git clone a repository from bitbucket.org to use my local SSH key, because I'm using sudo I'm preserving the ...
1
vote
1answer
1k views

How to NOT use ksshaskpass with ssh

When using ssh-agent I want to always enter my passphrase into a terminal, but ksshaskpass keeps popping up because the environmental variable SSH_ASKPASS is set, even though I'm not setting it ...
1
vote
2answers
961 views

Can't use OpenPGP key exported from GnuPG with SSH

I generated a PGP key with GnuPG over a year ago. Since I haven't had to really touch it since, I'm extremely foggy on the ins and outs of GPG (though I understand asymmetric key encryption in ...
9
votes
2answers
6k views

gpg-agent refuses SSH keys with ssh-add reporting “agent refused operation”

I'm using openssh7.5p1 and gnupg 2.1.21 on arch linux (these are the default versions that come with arch). I would like to use gpg-agent as an ssh agent. I put the following in my ~/.gnupg/gpg-...
1
vote
0answers
36 views

ssh-agent terminating on network change

My work computer is a painfully out of date Ubuntu 16.04 machine. I have it configured such that that lightdm invokes ssh-agent (not gnome-keyring-daemon) and ssh-agent invokes my session. This is not ...
1
vote
2answers
2k views

How to configure ssh-agent-forwarding?

Im struggling with setting up ssh-agent-forwarding. What I want to do: I want to have my public key on a ubuntu-server, the private key locally on my windows machine. I want to connect to the ubuntu-...
3
votes
1answer
655 views

How to organise SSH keys?

I've been creating multiple SSH keys in Debian for different accounts (namely Digital Ocean, GitHub, and Bitbucket), but it's getting messy very quickly. Listing the contents in my .ssh folder, I get:...
1
vote
1answer
159 views

Connect to target host through intermediate host without preliminary sharing the keys

I have a very big amount of machines that are accessible only from the intermediate host. I can share my ssh-keys with the intermediate host, but there is no sense to preliminary share the keys with ...
3
votes
2answers
831 views

How can I get computer to remember SSH key passphrase between reboots?

I've found various solutions to cache SSH key passphrases using such methods as ssh-agent, keychain, gpg-agent and so on. They all seem to cache it per-login or per-session, so that every time you ...
2
votes
1answer
292 views

How can I prioritize a ssh Forwarded Agent over an Identity File?

I was previously able to connect to my a server with ssh agent forwarding: ssh -A my.server And from there connect to another host on the server's network that had my public key in the ...