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
1 answer
43 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 ...
user avatar
1 vote
1 answer
71 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-...
user avatar
  • 11
0 votes
1 answer
22 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 ...
user avatar
  • 119
0 votes
1 answer
123 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 ...
user avatar
0 votes
0 answers
31 views

How to configure ssh agent forwarding for vncserver correctly?

I am connecting to my host with localhost>ssh -A myhost this makes my locah ssh-agent to forward it's key to remote host. On remote host I can myhost>ssh -A myhost2 and it works. Now I run ...
user avatar
  • 2,617
1 vote
0 answers
16 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------- ...
user avatar
  • 121
0 votes
0 answers
18 views

SELinux configuration to cache ssh key passphrase between reboots

I am using CentOS Stream 8. I added my ssh key to keychain: ssh-keygen -l eval `ssh-agent` ssh-add -k ~/.ssh/id_rsa # test connections ssh -T git@bitbucket.org ssh text passes in this terminal ...
user avatar
  • 101
0 votes
1 answer
254 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 ...
user avatar
0 votes
0 answers
85 views

ssh-agent pkcs11 uri to select certificate

I have two hardware tokens (Thales/Safenet eToken 5110cc) that both contains certificates for various uses. I'd like to add only one specific certificate to ssh-agent, however I'm struggling to find ...
user avatar
  • 171
1 vote
0 answers
227 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 ...
user avatar
  • 1,319
1 vote
0 answers
76 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=/...
user avatar
0 votes
1 answer
27 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 ...
user avatar
1 vote
0 answers
131 views

Systemd stop ssh-agent unable to find user-runtime-dir@ssh-agent.service

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 user-runtime-dir@ssh-agent.service doesn't exist. But ...
user avatar
0 votes
0 answers
44 views

Activate pop up to confirm ssh-agent access through agent forwarding

I have a successful ssh connection with agent forwarding activated on my Ubuntu 21.04. This is my ~/.ssh/config: Host my_host HostName server_address User my_username LocalForward ...
user avatar
0 votes
2 answers
256 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
  • 97
0 votes
1 answer
51 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-...
user avatar
2 votes
2 answers
1k 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` ...
user avatar
0 votes
0 answers
28 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 -> ...
user avatar
0 votes
0 answers
502 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 ...
user avatar
  • 1
0 votes
1 answer
134 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 ...
user avatar
1 vote
0 answers
441 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: ...
user avatar
  • 213
0 votes
0 answers
48 views

Passphrase required despite having setup authenticated keys via ssh

I continue to get a passphrase prompt with ssh despite already having set up the public key authetnitication on the remote server. I have already in the past done the following: Local Server chmod 700 ...
user avatar
7 votes
1 answer
526 views

Automatically running code before closing SSH connection

I'm remotely connecting to a shared server and I would like to have a line of code executed automatically in the remote machine before I close the connection (e.g. by pressing Ctrl+D). More ...
user avatar
0 votes
1 answer
220 views

Random SSH Agent Generates on Boot in tmp Directory Even with Networking Disabled

On a recently installed Debian system I noticed that every boot, even with no networking, a folder and empty socket file are generated in /tmp/ssh-(random_letters)/agent.xxx. On every boot the random ...
user avatar
0 votes
0 answers
40 views

Not able to forward ssh identity from jump box to target box

Let me make this a bit more clear. From my MacOS for work reasons I have to ssh to a jump box and then ssh to target boxes. Before I am able to ssh to jump box the ssh-agent will always ask for my ...
user avatar
1 vote
1 answer
497 views

MacOS: Installed openssh via brew, how do I add keys to keychain?

I installed openssh via brew install openssh. I added the following to my .profile: export SSH_AUTH_SOCK="~/.ssh/agent.$HOST.sock" ssh-add -l 2>/dev/null >/dev/null if [ $? -ge 2 ]; ...
user avatar
0 votes
1 answer
270 views

Use gnome-keyring from ssh session

I am a happy user of Debian/stable. From my running gnome session I can do all ssh operation (eg. git) without entering my ssh passphrase. However it stops working whenever I try to ssh to my running ...
user avatar
  • 2,129
1 vote
0 answers
127 views

Where do I export gnome-keyring-daemon's ssh agent socket so that it is available at launch of WM?

I use gnome-keyring to manage my ssh keys. In order for that to work, I must set $SSH_AUTH_SOCK accordingly, which is prodived by gnome-keyring-daemon -s. For use in shells, I can easily do this in my ...
user avatar
0 votes
0 answers
81 views

How to edit .bash_profile or .profile file. and Append the following text into it so these two commands will be executed every time the user login

In the following article https://www.linuxbabe.com/linux-server/setup-passwordless-ssh-login it says to edit .bash_profile or .profile. But I haven’t understood this line: Then edit .bash_profile or ....
user avatar
0 votes
1 answer
39 views

What tool can be used to to store ssh keys and how does it have to be configured?

I want use a keyring app that stores my passphrases for my ssh keys. Moreover I should be asked once when I connect to the session and then it is stored. At the moment I use ssh-agent and keyring in ...
user avatar
  • 315
2 votes
1 answer
136 views

GitHub auth and ssh keys on Debian: I've tried everything I could find

GitHub auth continues to fail for me despite my taking all the advice I could find on the Internet. Here are the permissions on my .ssh directory and keys. I have changed the private key permissions ...
user avatar
2 votes
1 answer
1k views

Unlock ssh key on login

When in the graphical environment, seahorse unlocks my ssh key (locked with a passphrase) so I can ssh to another host without entering a passphrase. But when on the command line, I am still asked for ...
user avatar
  • 111
0 votes
1 answer
261 views

sshfs mount on login with systemd and unmount on last logout

I'd like to mount (with sshfs) my documents directory - as unprivileged user - on first login and unmount it on last logout (not every logout, of course). I have key-based authentication working ...
user avatar
  • 111
9 votes
3 answers
8k views

sign_and_send_pubkey: signing failed for RSA key; from agent: agent refused operation

I have a new machine running debian sid on which I generated a new ssh key-pair. I wanted to find a convenient way to copy this new key-pair to various other machines using my old Ubuntu machine and ...
user avatar
0 votes
0 answers
89 views

Bad ssh key file can't be removed because part of missing user profile

An ssh key from a profile path that no longer exists is stuck in my ssh agent config. Now every time I boot my SSH agent I get /Users/missinguserprofile/.ssh/id_rsa: No such file or directory If I try ...
user avatar
  • 123
0 votes
0 answers
469 views

Why do we run `ssh-agent` with `eval`? [duplicate]

What is the purpose we run ssh-agent with eval `ssh-agent` not just ssh-agent ?
user avatar
  • 2,617
1 vote
1 answer
26 views

Run remote command while adding key to agent, to avoid passphrase prompt interfering with the script

How can I run a command at remote Host2 via remote Host1, while adding my key to the ssh-agent, so that the passphrase prompt does not interfere with the latter part of the script? I am basically ...
user avatar
4 votes
0 answers
448 views

"ssh-agent dwm" started from .xinitrc, but environment variables are not set

I got an .xinitrc file with the following line: # it will start my window manager ssh-agent dwm After that I got an ssh-agent process, but environment variables like $SSH_AGENT_PID and $SSH_AUTH_SOCK ...
user avatar
0 votes
1 answer
2k views

Why does `ssh-agent -k` not kill ssh-agent (macOS), or why is `SSH_AGENT_PID` not set?

I'm trying to troubleshoot a sudden outbreak of short-lived SSH connections. These connections are initiated from my Mac (MBP, Catalina 10.15.6, zsh) to some of the Linux "appliances" that ...
user avatar
  • 2,196
0 votes
1 answer
648 views

SSH client denying connection with error "too many files open"

Running a reverse ssh client on a machine. After some time get a connection denied request, with logs on the ssh client stating Oct 12 00:21:19 ipaserver0 reverse-tunnel.sh: debug3: channel 1018: ...
user avatar
1 vote
0 answers
285 views

Bash Script - ssh-agent and ssh-add with confirmation?

This is about the use of the confirmation flag with ssh-add in a shell script. Here's the questions: Is using the '-c' being paranoid in the case below? Is it pointless, is it not actually adding any ...
user avatar
  • 305
2 votes
0 answers
304 views

Funtoo Keychain keeps asking for password when logging in using SSH

I have followed the instructions here https://www.funtoo.org/Keychain and added eval `keychain --eval --agents ssh --inherit any id_rsa` to - I have tried both but the result was the same - .zshrc ...
user avatar
  • 2,012
1 vote
1 answer
2k views

ssh-agent on MAC os

I've been trying to setup my forward agent on my device so I can Git commit & git push from a remote server. I go through the normal commands to get setup: ssh-agent eval "$(ssh-agent)" ...
user avatar
  • 11
0 votes
1 answer
959 views

ssh client not trying publickey authentication on port 22

I am trying to ssh from an Ubuntu machine ( VM on Win 10) to a linux server using public keys (DSA). However the OpenSSH client on the Ubuntu does not try public keys as authentication method even ...
user avatar
  • 1
2 votes
1 answer
3k views

ssh-add not able to connect to ssh-agent

I know that ssh-add is "front-end" of ssh-agent. But ssh-agent on my computer is already running (I could find it in top). When I type ssh-add, it said "Could not open a connection to ...
user avatar
0 votes
1 answer
42 views

Does ssh use the ssh-agent?

I can ssh into this machine ssh user@remote_machine.com and it always works. However I discovered that ssh-add -l shows no key (I had to replace my laptop a month ago). Does it mean that the ssh tool ...
user avatar
  • 863
2 votes
1 answer
331 views

How does ssh-agent start on boot?

I've just installed Fedora, and noticed that ssh-agent is already started on boot. Out of curiosity, I checked /usr/lib/systemd/system/ and didn't find it listed as a service there. I didn't find it ...
user avatar
  • 4,045
2 votes
2 answers
856 views

openssh - add keys to agent when entered

Whenever I enter my password, in e.g git, ssh, I want it to be remembered. So I have conifgured ssh-agent I also added AddKeysToAgent yes to ~/.ssh/config If I run ssh-add now every thing is fine. ...
user avatar
1 vote
1 answer
6k 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 ...
user avatar
1 vote
0 answers
401 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. ...
user avatar

1
2 3 4 5