ECC keys should work, but haven't tried that (I use RSA-4096).
https://github.com/lfit/ssh-gpg-smartcard-config/blob/master...
https://developers.yubico.com/PIV/Guides/
There are a number of tools you can install yubico-piv-manager/yubico-piv-tool but check the guides.
I had some problems with this, somehow I could not add the key to ssh-agent, but that was related to the ssh-agent, not sure its a general problem.
Note, this does only support 2k keys. If you use the GPG Smartcard and a Authentication Subkey you can get 4k keys. The advantage of PIV is that you can actually use ssh-agent and you don't have to use gpg-agent. Gpg-agent does not have all the features that ssh-agent does, and for me that was relevant.
I prefer to keep the two separate anyways.
EDIT: Never mind, it works perfectly, thanks!
How did you solve it?
Unfortunately, there's no perfect solution, so I just added an alias "yubissh" to include the library in the command line :(
You want a Y4 if:
* You SSH into sensitive machines.
* You log into a VPN that you control and can configure to use the Y4.
* You're actually relying on PGP.