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.

Filter by
Sorted by
Tagged with
1
vote
1answer
74 views

Disable su and sudo access for users

I have created a couple of users who use their SSH Keys to log in on a server. I don't want any user to have root access, i.e, no user should be able to do sudo su or su - another user. When I check ...
1
vote
0answers
48 views

Is there a way to daisy-chain SSH commands using ssh config?

I am trying to SSH from a docker container to a remote server. The docker container is on a Mac. All the authentication to connect to the remote server is done from the Mac, not the docker container. ...
1
vote
1answer
32 views

How to force ssh agent forwarding to continue in screen after you disconnect?

I want to connect to a host from which I will run ansible playbook using screen. Using screen allows me to have the playbook finish in case my ssh connection gets interrupted or terminated. So far no ...
1
vote
0answers
18 views

ssh key connectivity issue outside of ~/.ssh dir

I have created the following structure under ~/.ssh ~/.ssh /keys /aws /prod /stage and i put appropriate '.pem' private keys under these folders. All directories ...
0
votes
1answer
80 views

Is it possible to enable agent forwarding when you have a conflicting key with in known_hosts?

Whenever I connect to my host, I see @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...
0
votes
1answer
43 views

using ssh-agent to ssh into a remote server without typing the password

I am trying to use ssh-agent to ssh into a remote-server. I understand that when I add my localhost's public_key to the remote-server's ./ssh/authorized_keys, I can ssh into the server without typing ...
0
votes
0answers
69 views

What is the proper configuration for gpg, ssh, and gpg-agent to use GPG auth subkeys for SSH with pinentry in a multi-session tmux environment?

Context I would like to use GPG authentication subkeys instead of SSH keys. I would also like to use gpg-agent to manage password caching for these keys. I am running in a headless environment, so ...
1
vote
1answer
41 views

ssh using different key when forwarding authentication agent [closed]

I am trying to convince ssh to use my ed25519 id file whenever possible. In order to achieve this and according to this stackexchange question and the man page which states It is possible to have ...
1
vote
1answer
55 views

SSH key added on boot without password prompt - how and why?

I have a passphrase-protected SSH key stored in ~/.ssh/id_rsa. In my .zshrc I have this fragment: if ! ssh-add -l > /dev/null; then ssh-add fi After booting, I usually open the terminal, see ...
0
votes
1answer
76 views

Can I use a SSH key with git directly, without depending on ssh-agent?

I have a SSH key to allow me to push to a certain repository. No problem there with the key itself - however, I don't want to copy the key to a .ssh folder or leave the SSH key with ssh-agent (on ...
0
votes
0answers
34 views

ssh-agent stuck after network change to vpn

I am using several Ubuntu 18.04 linux hosts, and I log in from my Windows 10 laptop with Pageant as an ssh agent forwarder, which helps me use git/Github on those hosts without needing to put my keys ...
1
vote
0answers
29 views

ssh-agent is evoluting on it's own

From my point of view the only config I had, was line ssh-add -k in my .bashrc and it was working. I.e. I was able to do ssh -A and was seeing my key with ssh-add -l on remote hosts. Suddenly this ...
0
votes
0answers
54 views

Using ControlPath/ControlMaster as well as ssh-agent?

I work with Linux servers in an AWS VPC - there is only one server with a public IP address, the bastion, and to access any of the others, I first log on to the bastion and then on to whichever server ...
0
votes
1answer
61 views

Why does systemctl asks for a sudo password in user mode?

I am currently trying to start my ssh-agent every time I login by starting it as a user service with systemd as explained in the arch wiki. However, when I execute systemctl --user start ssh-agent, ...
2
votes
1answer
61 views

Does ssh-add honor the declarations made in ssh_config file(s)?

Background I use a 4096-bit RSA key-pair for authorizing access to my server. By ssh_config files I am referring to ~/.ssh/config and /etc/ssh/ssh_config. Here's what my ~/.ssh/config looks like: ...
0
votes
0answers
210 views

SSH freezes after entering password, Fedora

I recently installed Fedora 30 on my new laptop (Lenovo Thinkpad E495). My problem is: when I try to connect to my server through SSH, is asking me the password. I enter the password and after this ...
0
votes
1answer
156 views

how to copy ssh key from client server to linux desktop using scp

I want to copy ssh key id_rsa and id_rsa.pub from client-server to Linux desktop folder. I already test it scp command for a copy from Linux server to client-server scp id_rsa.pub username@client_ip:/...
1
vote
1answer
70 views

Delay `ssh-add` passphrase prompt until first use

I would like ssh-add to delay asking for the passphrase to my private key(s) until they are first accessed. The reason for this is that I would like to start ssh-agent on login and add keys to it, ...
2
votes
2answers
153 views

FreeBSD sudo root and ssh-agent

I'm trying to access a git server from my FreeBSD 11.3 box via root account. git server is secured to only allow access via SSH public key authentication. When I log into my FreeBSD box, I do that as ...
1
vote
1answer
493 views

Debian ssh issue after Buster upgrade

After I upgrade my laptop to Buster (stable) from Stretch (old Stable) I get the following error while I try to connect to my remote workstation: ssh workstation sign_and_send_pubkey: signing ...
1
vote
2answers
568 views

How to launch the password in pssh command

when we want to use pssh in order to get in parallel the command output from remote machine we can do ( for example ) pssh -H presto01 -l root -A -i "hostname" Warning: do not enter your password if ...
3
votes
1answer
127 views

SSH keys can't be deleted from agent

My Ubuntu 18.04 keeps adding all my SSH keys into the ssh agent upon startup and I am unable to delete them. Having so many keys in the agent breaks authentication to servers that only permit 3 or 5 ...
3
votes
1answer
188 views

Why does SSH_AUTH_SOCK and SSH_AGENT_PID unsets after a while in Amazon Linux?

We have a build system that needs an active ssh connection with mercurial and to do so, it needs an ssh-agent loaded with a key constantly.. The thing is that, even though that after creating the ssh ...
1
vote
0answers
1k views

Run a section of AWS userdata as ec2-user

I am trying to pull some git repos in my EC2 userdata, but want to pull them as ec2-user rather than root. As I dont want the private key on the disk I am using ssh-agent to load a key from Parameter ...
2
votes
1answer
305 views

ssh-add -l does not show the location of the SSH key(s)

When I run ssh-add -l, it does not show the location of the SSH key(s). It outputs the following: 4096 SHA256:bBMtB9wL6RXRWhvx5M+LDox6A2gq61CDtZN9F4bi3Gw masoud@x.y (RSA) 2048 SHA256:QbCO5y5SX+CSHd6++...
2
votes
1answer
155 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 ...
1
vote
2answers
5k 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
104 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 ...
2
votes
0answers
216 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
362 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
245 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
253 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 ...
1
vote
0answers
329 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
99 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:~$ ...
1
vote
1answer
329 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
251 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
1answer
378 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
2k 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
2k 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
92 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
35 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 (...
35
votes
3answers
31k 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?
1
vote
0answers
308 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
64 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 ...
1
vote
0answers
203 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 ...
5
votes
1answer
2k 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
399 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 /...
4
votes
2answers
1k 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
372 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
1k 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. ...