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.
280 questions
1
vote
2
answers
657
views
Why is ssh-agent ignoring the lifetime in .ssh/config?
I can't get ssh-agent to work like I want to. It keeps removing the saved identities on reboot.
I use AddKeysToAgent in my .ssh/config like this:
AddKeysToAgent 30w
That's the top of the file, ...
0
votes
1
answer
154
views
How to connect and browse files of remote server via Midnight Commander's Shell link (copy files over SSH) if the private key requires password?
There are endless number of helpful articles and answers on how set up ~/.ssh/config (e.g., this one's pretty good), but none of them mentions what to do if the private key is also password protected.
1
vote
1
answer
350
views
Repeated "from agent: agent refused operation", even after having added private key
I am trying to unlock the gnome keyring on my server machine so that I can push git commits via ssh to github. The ssh key for this is encrypted. What I tried is this:
# See https://unix.stackexchange....
4
votes
1
answer
153
views
How can I reverse forward git ssh when my config requires a Yubikey
I frequently need to log into a VM that has no direct access to the internet or our source code repo. In the past I have circumvented this with a reverse port forward over ssh but now my problem is ...
0
votes
2
answers
240
views
ssh agent forwarding - what's going on under the hood?
When I ask Google how ssh agent forwarding works it gives me lots of links to SEO optimized rubbish explaining how to provision ssh-agent. That is NOT what I am asking.
I currently have an issue where ...
0
votes
2
answers
114
views
Has the default behaviour of trying ssh-agent keys changed?
At some time in the past whenever I tried an ssh connection to a server without specifying the password ssh would try all the keys in ssh-agent to the point where if there were too many keys, my IP ...
11
votes
4
answers
1k
views
How can I secure unencrypted credential files, for programs that assume them (like gmi/lieer)?
Brief
Q: How can I cryptographically secure a credentials file that is stored on disk as plaintext?
Or, rather: how can I avoid storing credentials like those for Gmail and other API keys on disk? ...
0
votes
1
answer
978
views
Unable to add keys with ssh-agent plugin in zsh
I just installed arch, and I am trying to configure my shell, zsh.
I am currently using zinit as my plugin manager with powerlevel10k.
I was trying to automate the activation of the ssh-agent and the ...
0
votes
2
answers
464
views
First ssh-agent request fails on WSL with systemd socket-activation
Running Fedora on WSL2, I find that the socket activation on ssh-agent doesn't quite work properly: the first request that triggers the actual service starting fails. This may be a git fetch or git ...
1
vote
1
answer
2k
views
How do I get ssh-askpass working in Wayland, on KDE?
I'm trying out Wayland on KDE 6.1, to work around some other issues. I rely heavily on ssh-askpass for confirming use of ssh keys (for local pam and remote connections) and don't want to give this up.
...
1
vote
1
answer
104
views
ssh agent forwarding when disk is full (and I cannot free any)
Target system can only be logged into using public key authentication using a named user. The password is disabled. We use ssh-agent forwarding in combination with libpam_ssh_agent_auth to allow ...
0
votes
1
answer
137
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 ...
0
votes
2
answers
2k
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 ...
2
votes
0
answers
248
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 ...
1
vote
2
answers
629
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: ...
0
votes
1
answer
610
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 ...
-1
votes
2
answers
114
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 ...
1
vote
1
answer
204
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?
0
votes
1
answer
156
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 ~/....
2
votes
1
answer
2k
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 ....
0
votes
1
answer
128
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 ...
2
votes
0
answers
379
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 ...
0
votes
0
answers
2k
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 ...
1
vote
0
answers
2k
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 ...
0
votes
1
answer
1k
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
...
0
votes
0
answers
66
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 ...
1
vote
2
answers
15k
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 ...
3
votes
1
answer
15k
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
#...
2
votes
1
answer
261
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 ...
0
votes
1
answer
240
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 ...
0
votes
5
answers
1k
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 ...
1
vote
1
answer
2k
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, ...
0
votes
2
answers
1k
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/...
17
votes
3
answers
17k
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: "...
2
votes
1
answer
494
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 ...
0
votes
1
answer
573
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 ...
0
votes
1
answer
152
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, ...
1
vote
0
answers
410
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 -...
1
vote
1
answer
3k
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 ...
1
vote
0
answers
145
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/...
1
vote
1
answer
2k
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 ...
1
vote
1
answer
859
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 ...
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-...
0
votes
1
answer
286
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 ...
0
votes
1
answer
1k
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 ...
1
vote
0
answers
71
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------- ...
0
votes
2
answers
4k
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 ...
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 ...
1
vote
1
answer
487
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=/...
0
votes
1
answer
50
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 ...