SSH from my PC to Container inside Server

I’m new learner using LXD. Now I have a problem. I want to ssh my lxd container inside my server from my desktop pc at home. How to do that? any tutorial for do this?

thanks
kurnia

If you want your container visible from all device in the same network, you can create bridge network interface in host os. then create profile in lxd named it example eksternal then put bridge network from host os to parent in eksternal profile. Look at my SS below:

create lxd profile:
lxc profile create eksternal
lxc profile edit eksternal
you can put like this:

description: Ekternal Access Profile

devices:
eth0:
name: eth0
nictype: bridged
parent: br0
type: nic

then you can access via all device in your the same subnet mask.

Done.

If you can ssh from your host to the container and can ssh from your home in your host, either

  • set a nat forwarding rule in your host’s firewall from any port you want, for example 1022, to the port 22 of yourcontainer
  • or use the proxyJump feature of ssh (man ssh-config)