SSH server for LXD containers - ssh2lxd

I would like to share this open source project that was originally developed almost a year ago for an internal project.
But today we decided to release it to the public.

ssh2lxd is an SSH server that allows direct connections into LXD containers. It uses LXD API in order to establish a connection with a container and create a session.


  • Authentication using existing host OS SSH keys via authorized_keys
  • SSH Agent forwarding into a container session
  • Full support for PTY (terminal) mode and remote command execution
  • Support for SCP and SFTP*
  • Full Ansible support with fallback to SCP

That should be very useful for those cases where you can’t easily make something get native support for the LXD exec API but where SSH is supported.