Restricting SSH Agent Keys
lwn.net
lwn.net
The outer system has the key, and the inner bastion system has the acl to connect inward to actual servers. Works well.
Of course, I still make sure to only use `-A` to servers I trust.
I want to add every key to ssh-agent on my local machine, be able to login into remote hosts with them but have a pop-up confirmation if there's an agent access from remote host where agent is forwarded.
The problem basically is the current agent forwarding protocol doesn't have a way to reliably identify the source and remote host that can't be spoofed. guardian-agent tries to do that using some extra software, this linked SSH proposal is to add that to SSH but it will require software upgrades even to the sshd of the intermediate and remote hosts - it's not ideal that it can't just work out of the box - but I welcome this we just need to get it done now for later.
I frequently finding myself thinking about adding useful things to software I want to use now and go well it will be years before its on every host I use and can be used reliably. I have had this thought on and off for more than a decade. Ship some new stuff, it'l be great later :D
> OpenSSH 8.9 will include the ability to control how and where keys in ssh-agent may be used, both locally and when forwarded (subject to some limitations).
I use ProxyJump to get to host X, but I also need ssh-agent forwarding to copy files directly from host X to host Y. Luckily I don't need to copy files in such way in every interactive session so I guess I can disable agent forwarding by default
$ ssh -J <bastion> hostX base64 srcfile | ssh -J <bastion> -t "base64 -d /dev/stdin > dstfile"
Having to use the local machine as an intermediary is a bit hacky but I know something like this is how emacs handles remote files (IIRC it also uses gzip).my colleagues used approach with manually launching nc on hosts X and Y to avoid using the intermediate host. But that's also hacky ( though probably faster than ssh due to lack of encryption )