the fact that the ssh-agent process is running on a remote machine already hints that you are probably not using it for its intended purpose.
quote from man ssh-agent
:
PC, laptop, or terminal. Data passphrases never go over the network.
my free translation:
the idea is that ssh-agent runs on the local computer. so that no authentication data need to be stored on another machine, and no passwords are transmitted over the network.
judging by this fragment:
$ ssh-add .ssh/devloop
You want to authenticate on some other remote machines from the first remote machine using the key stored on the remote machine (in the ~/.ssh/devloop
).
in this case, it makes no sense for you to run the ssh-agent process on this remote machine. in order to authenticate on other machines using this key, you can use any of the following options:
- rename the
~/.ssh/devloop
to ~/.ssh/id_rsa
. This option will not work if such a file already exists and you need its contents for some other purpose. Explicitly specify this file when connecting:
$ ssh -i ~/.ssh/devloop другая-отдалённая-машина
Add the following line to the beginning of the ~/.ssh/config
file:
identityfile ~/.ssh/devloop
then ssh will attempt to use this file during authentication.
if this file needs to be used only for authentication on only a few specific machines, then it is better to add a section to the end of the ~/.ssh/config
file instead of the specified line:
host машина1 машина2 машина3 identityfile ~/.ssh/devloop
but if I guessed wrong, and you actually need the ssh-agent process, then it is better to run it as a “layer” (as it is actually used in modern distributions), i.e. immediately indicate when connecting a command like ssh-agent оболочка
, like this:
$ ssh -t отдалённая-машина ssh-agent bash
the -t
option here is necessary for tty to be allotted (if you do not specify a command, i.e., to initiate the launch of the shell, then tty is automatically assigned).
and, perhaps, it would be better to use a terminal multiplexer ( screen , tmux , etc.), which, by the way, can also be run with an “interlayer” in the form of ssh-agent , like this:
$ ssh -t отдалённая-машина ssh-agent screen
ps and, yes, the question does not carry any distributional specifics, but only concerns the openssh client.