Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
0 votes
0 answers
21 views

ssh-add with opensc failed

I'm setting up a Ubuntu 20.04 to visit servers that require PIV authentication. The command ssh-add -s /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so fails with: Could not add card "/usr/lib/x86_64-...
fiedel's user avatar
  • 1
0 votes
0 answers
26 views

Launching via Plasma shortcut removes ssh-agent's environment variables

Running Plasma 5.27.10 on Debian testing/trixie. An ssh-agent is launched via user service /usr/lib/systemd/user/ssh-agent.service and its socket is exposed in my session's environment variables. All ...
Tarmo's user avatar
  • 101
0 votes
0 answers
26 views

How to set ACL permissions for SSH_AUTH_SOCK in a RemoteCommand?

I'm trying to forward my SSH agent and then grant permissions to the SSH_AUTH socket. The permissions are for another user on the remote host. My ssh config: Host myhost Hostname 1.1.1.1 ...
dimid's user avatar
  • 627
0 votes
2 answers
195 views

Why is ssh-agent.service running, but when I use ssh-add I get an error connecting to the agent?

The ssh-agent service is enabled for the user and is running without errors. (status is active). But when I try to use ssh, I get the error Could not open a connection to your authentication agent.. I ...
Daniil Screpchenko's user avatar
0 votes
0 answers
38 views

ssh-agent doesn't accept passphrase on first load

When there is no ssh-agent process running, when I open my terminal, the ssh-agent is started and it asks me for my passphrase for my private key. Every time I try to enter it, I get an error: Bad ...
kataba's user avatar
  • 11
2 votes
0 answers
87 views

ssh-agent with multiple keys

I have a script which retrieves private keys from a repository database and adds them to the ssh-agent with ssh-add - <<<"----My Private Key----" The keys don't get stored on the ...
Kai78's user avatar
  • 21
1 vote
2 answers
78 views

Can't SSH in to remote server due to bad config

I wrote a bad SSH config on a remote server while setting up Git and now I cannot access the server. Here is the error: /users/<user>/.ssh/config: line 2: Bad configuration option: ...
Henrik VT's user avatar
  • 111
0 votes
1 answer
103 views

systemd service for ssh-agent with loading of identity files for each login

I am trying to set-up an automated way to load my ssh keys at login. I have the below configured: ❯ cat .ssh/config Host github HostName ssh.github.com User git Port 443 AddKeysToAgent ...
Mike O.'s user avatar
-1 votes
2 answers
45 views

ssh command just exits the sesssion

I have this: ssh -i "alex-kp.pem" '[email protected]' ' cd codes/vbe eval $(ssh-agent) ssh-add -D ssh-add ~/.ssh/id_vbe ' it executes the commands ...
Alexander Mills's user avatar
0 votes
1 answer
64 views

Change passphrase of SSH key stored in the gpg-agent

How do I change the passphrase of an SSH key that is stored in the gpg-agent?
iGEL's user avatar
  • 101
0 votes
1 answer
95 views

Undo SSH Key-Based Authentication

I'm using a Debian 11 (Bullseye) with Gnome Desktop. For testing I implemented a SSH key-based authentication by creating a key-pair (transferring the public key to the remote host) and modifying ~/....
truth's user avatar
  • 1
1 vote
1 answer
1k views

Unable to get ssh-agent and ssh-add to work in remote server

We have a remote server which we use to build a certain part of our software. Part of that build process needs access to a private bitbucket repository. Normally in my local machine I have set the ....
Corcus's user avatar
  • 111
0 votes
1 answer
56 views

password to linux changed after deleting/manipulation with ssh

Unfortunatelly I made mistake somewhere but can't get where. I had issues with ssh and github, tried different things and they didn't work. Later I decided .. i think.. moved file i balieve it was ...
Maks Chornyi's user avatar
1 vote
0 answers
202 views

Lazy load SSH keys from remote server using SSH agent and AddKeysToAgent

I have my ssh-agent configured with AddKeysToAgent yes to lazy load keys into the agent only when they are first used. I also configured ForwardAgent yes in my ssh config for a remote server. I want ...
F21's user avatar
  • 211
0 votes
0 answers
1k views

"No such file or directory" but SSH_AGENT still runs correctly?

I am new to SSH and am currently using a SSH connection to my Github repositories because I don't want to setup a HTTPS connection. This is what my script looks like #!/bin/bash eval "$(ssh-agent ...
TC_neva's user avatar
1 vote
0 answers
942 views

Ubuntu 22.04 ssh-agent identities not added correctly?

I have my ssh identities added at the end of the .bashrc script, as the server says here when I log in, Agent is running with pid 8411 and all of the identitias are added. As is also evident from the ...
Matt Welander's user avatar
0 votes
1 answer
540 views

Connecting to currently running ssh-agent

After creating an agent, it automatically detaches itself from the parent process. someUser@MyPC:~$ eval "$(ssh-agent -s)" Agent pid 10222 someUser@MyPC:~$ ps -e --forest | grep ssh-agent ...
learningdudz's user avatar
0 votes
0 answers
49 views

Individual connection of people via ssh

I have different users on the server and each of them has a username and password I want each user with his own username to be able to connect to the server with only one device at a time and not to ...
Hossein Sharbati's user avatar
1 vote
2 answers
4k views

ssh-agent: how it works?

I want to try the ssh-agent to login without password (I already know gssapi and pubkey methods, but I want to learn this). On client and server I had enabled AgentForward on ssh_config (client) and ...
elbarna's user avatar
  • 12.7k
2 votes
1 answer
8k views

WSL2 Ubuntu: How to start ssh-agent and add ssh key automatically on each terminal start up

I'm using WSL2, on Terminal, with Ubuntu installed. I have added the following to my .bashrc: # Start ssh-agent # check if ssh-agent is already running if [ -z "$SSH_AUTH_SOCK" ]; then #...
Nik Shafiq Sirhan's user avatar
2 votes
1 answer
100 views

What is the -l (lowercase L) switch of the ssh-agent command?

I see the following on macOS: $ ps ax | ag ssh-agent 8677 ?? S 0:00.60 /usr/bin/ssh-agent -l Looked up ssh-agent's man page on the terminal, but it has no mention of a -l switch. None of the ...
toraritte's user avatar
  • 1,080
0 votes
1 answer
132 views

How to kill ssh agents started by script managed by systemd?

I want to start an ssh-agent instance when my user logs in. I also want several specific keys added to that agent after it has been created. I should be able to start and stop the agent through ...
Lester Peabody's user avatar
0 votes
5 answers
760 views

How to start ssh-agent without eval

What I already know To start ssh-agent you need to use the command eval $(ssh-agent) You have to do this because of security reasons. A child process can't change environment variables of the process ...
Bog's user avatar
  • 1,034
1 vote
1 answer
968 views

How to use a GPG key for SSH on macOS

Basically, my goal is to use a single key for everything. I have a GPG key that I imported onto my MacBook, and would like to use that key for SSH authentication. However, despite my several attempts, ...
Apoorv Chauhan's user avatar
0 votes
2 answers
748 views

Failing at SSH Agent Forwarding

I have a DigitalOcean droplet into which I'm attempting to clone a repo from Github. This works fine on my local machine, and I've been following the guide from Github here: https://docs.github.com/en/...
Adaddinsane's user avatar
11 votes
3 answers
6k views

How do I set up KDE, KWallet and ssh so I'm not asked to enter my ssh passphrase?

I have ssh keys set up and I can see my key in KWalletManager under ksshaskpass. How do I get it so that I am not asked for my ssh passphrase eg. every time I do something in Git. (It says: "...
mcarans's user avatar
  • 605
2 votes
1 answer
327 views

manage many ssh keys via ssh-agent

I use keepassxc (my password manager) to manage my ssh keys. This means the keys are stored within the database (not stored on disk in a traditional way). When I unlock my password database, all keys ...
laalsaas's user avatar
  • 155
0 votes
1 answer
376 views

What is the key type for the ssh_host_key file in SSH?

In Ubuntu and Fedora in the /etc/ssh/ directory exists the following files: ssh_host_key ssh_host_dsa_key (not available in Fedora) ssh_host_ecdsa_key ssh_host_ed25519_key ssh_host_rsa_key For the ...
Manuel Jordan's user avatar
0 votes
1 answer
96 views

How can gnu-screen windows be configured to inherit the same ssh-agent session from the terminal?

I want to link some passwordless SSH logins to some screen sessions, so that anytime a window is opened in the screen session the ssh-agent is inherited, but whenever I open a new window in screen, ...
vfclists's user avatar
  • 7,551
1 vote
0 answers
267 views

ssh-add is missing the argument -A to load all keys at once

For the past years after a reboot I used to run ssh-add -A that loaded all my keys ( the previously i've added with -k ) back to the agent. But now I received a new laptop ( MacOSX Monterey ) and the -...
Ricky Levi's user avatar
1 vote
1 answer
2k views

Gitlab /dev/tty no such device or address

Among the many question already asked none seem to answer my problem. So i'm trying to setup a ci/cd pipeline with gitlab and i'm stuck in the deploy job with ssh. So I have a buildserver which there ...
Technology Researcher's user avatar
1 vote
0 answers
115 views

Why do I need to start ssh-agent twice?

I'm on a Raspberry running Raspbian GNU/Linux 11 (bullseye). Im stuck with a strange behaviour. After booting, ps -ef | grep ssh says root 482 1 0 16:03 ? 00:00:00 sshd: /usr/...
fbstov's user avatar
  • 9
1 vote
1 answer
975 views

Start a system wide SSH agent

Currently, I have commands to start the SSH agent in my .bashrc file. The trouble is that this only works in a particular terminal - each time I open a terminal, I'm asked for my private key's ...
Frost Ravenstorm's user avatar
1 vote
1 answer
456 views

ssh-add without prompt

I am working on some shell and I encountered the following line: cat /ssh/sshkey | tr -d '\r' | ssh-add - This code get a key and add it to an agent. This work on its current environment, but when I ...
Saurazim's user avatar
1 vote
1 answer
2k views

SSH_AUTH_SOCK set to wrong value after login but there is nothing that sets it explicitly

I am using KDE on Arch Linux and I am trying to run gpg-agent in ssh-agent emulation mode as described here. I created env file ~/.config/environment.d/80_gpg_agent.conf for systemd-environmentd-...
gudvinr's user avatar
  • 21
0 votes
1 answer
212 views

Funtoo keychain - how to avoid blocking i3 login?

I'm using Funtoo keychain on Ubuntu 22.04 and I have followed the instructions to add the following to ~/.profile: eval `keychain --eval --agents ssh id_rsa` I'm running the i3 window manager, from ...
davidA's user avatar
  • 171
0 votes
1 answer
988 views

ssh client and cannot connect to X server

my computer is Windows (Ubuntu), the host is Linux. I am trying to access a visualization program on the host computer (Linux) in my office from my home laptop (Windows) via ssh client and when trying ...
MajesticMarkUp's user avatar
1 vote
0 answers
57 views

It seems I have SSH keys saved under two emails, but I can't find one of them, how can I find an SSH key that is "already imported?"

I am on machine B and seeking to SSH into machine C. I failed to, which made me think perhaps I haven't actually set up my SSH keys on machine B. If I do ls -al ~/.ssh on machine b, I see -rw------- ...
Caleb Jay's user avatar
  • 121
0 votes
1 answer
3k views

ssh-add is always asking for passphrase - Automate it on bashrc

I want to add to my bashrc the code: eval $(ssh-agent -s) ssh-add ~/.ssh/id_rsa but it is always asking to Enter passphrase for /home/User/.ssh/id_rsa: A friend of mine add the same snippet to bashrc ...
BigdataADD's user avatar
3 votes
1 answer
3k views

Enable SSH access using a GPG key for authentication : The agent has no identities

I have followed How to enable SSH access using a GPG key for authentication to enable SSH access using a GPG key for authentication. $ gpg2 --expert --edit-key <KEY ID> gpg> addkey Please ...
Ahmad Ismail's user avatar
  • 2,688
1 vote
1 answer
361 views

Writing a bash script to sftp with ssh-keys that have a password - SSH_ASKPASS is not working

I am writing a script in bash to sftp files to another server. I have an SSH key with a password as its required. I have tried using SSH_ASKPASS variable but its not working. DISPLAY=: SSH_ASKPASS=/...
Shane Miller's user avatar
0 votes
1 answer
33 views

SSH with passphrase on three servers

I have three servers A,B, and C. I need to do is to run something like: my_self@A:~$ ssh B "ssh C run_a_script_here" This works if I have my ssh keys setup correctly on A,B,C, and I do not ...
Philip Shangguan's user avatar
1 vote
0 answers
372 views

Systemd stop ssh-agent unable to find [email protected]

I've got the following service to start and stop the ssh-agent. Which I intend to start/enable for --user. Problem is I get the error message that [email protected] doesn't exist. But ...
cookieforu's user avatar
0 votes
2 answers
4k views

Keepass Keeagent SSH Keys How to integrate with a bash terminal?

I am completely lost here. I found out about storing ssh private keys (of which I have a lot of) in my keepass database. Before I had a bash script with a simple menu that would just use ssh -i and ...
user avatar
0 votes
1 answer
203 views

Mistakenly had nano at the beginning of ps -e | grep ssh-agent

Like I said in the title, I accidentally ran this: nano ps -e | grep ssh-agent Now when I properly run ps -e | grep ssh-agent I see this: # ps -e | grep ssh-agent 1613 ?? 0:00.05 /usr/bin/ssh-...
Mike Ciffone's user avatar
5 votes
2 answers
5k views

Why should I kill ssh-agent on logout?

I have set up ssh-agent on my macOS laptop, and a 24x7 running server. Why do I need to kill ssh-agent on every logout? Source of my knowledge of ssh-agent: https://kb.iu.edu/d/aeww eval `ssh-agent` ...
ratherlongname's user avatar
1 vote
0 answers
125 views

ssh-add -l shows no key but agent forwarding is working

I log in on the server with my public key Agent forwarding should be enabled, Defaults:user env_keep += SSH_AUTH_SOCK is in the /etc/sudoers This works at my setting at home (Ubuntu Mate 20.04 -> ...
JokerGermany's user avatar
0 votes
0 answers
2k views

Permanently add key to ssh-agent and delete key from disk exactly like in Windows

In Windows, you can run ssh-agent as a service, permanently add ssh keys (per user), and then delete those key files from disk so they are no longer there at all. You cannot retrieve the key from the ...
Mickey's user avatar
  • 1
0 votes
1 answer
779 views

ssh-agent does not work when connecting to my desktop via ssh

I have ssh-agent running on my desktop, and it works normally. That means I can use my ssh key without password. When I connect to my desktop via ssh, I suddenly cannot use my ssh-agent - ssh asks me ...
Martin Vegter's user avatar
1 vote
0 answers
1k views

bashrc function to add a specific ssh key to the current terminal

In order not to have to type the passphrase for every single git command I use to fetch/pull/push code from a remote machine I'm logged onto, to git{lab|hub}, I added this alias in my .bashrc file: ...
s.k's user avatar
  • 461

1
2 3 4 5 6