LXD noob who is trying to setup allowing SSH connections directly into my LXD guest containers for Ubuntu 18.04 and CentOS 7.5 but seems CentOS version has a missing /etc/ssh/sshd_config ? I am following info at https://stackoverflow.com/a/21874613/272648
on Ubuntu container
lxc exec ubuntu18 -- ls -alh /etc/ssh/
total 596K
drwxr-xr-x 2 root root 4.0K Jun 4 20:16 .
drwxr-xr-x 87 root root 4.0K Jun 4 20:16 ..
-rw-r--r-- 1 root root 541K Feb 10 02:31 moduli
-rw-r--r-- 1 root root 1.6K Feb 10 02:31 ssh_config
-rw------- 1 root root 668 Jun 4 17:46 ssh_host_dsa_key
-rw-r--r-- 1 root root 603 Jun 4 17:46 ssh_host_dsa_key.pub
-rw------- 1 root root 227 Jun 4 17:46 ssh_host_ecdsa_key
-rw-r--r-- 1 root root 175 Jun 4 17:46 ssh_host_ecdsa_key.pub
-rw------- 1 root root 399 Jun 4 17:46 ssh_host_ed25519_key
-rw-r--r-- 1 root root 95 Jun 4 17:46 ssh_host_ed25519_key.pub
-rw------- 1 root root 1.7K Jun 4 17:46 ssh_host_rsa_key
-rw-r--r-- 1 root root 395 Jun 4 17:46 ssh_host_rsa_key.pub
-rw-r--r-- 1 root root 338 Jun 4 20:16 ssh_import_id
-rw-r--r-- 1 root root 3.2K May 22 10:54 sshd_config
The Ubuntu cloud images include sshd by default, the CentOS images do not. yum install openssh or something along those lines should get CentOS into the same state as Ubuntu.
Also, that post on stackoverflow is about LXC, not LXD. See Comparing LXD vs. LXC for the differences.
An easy way to figure out whether a tutorial is about LXC or LXD, is when they use commands like lxc-start (with dash) (these are old LXC), or whether they use commands like lxc launch ubuntu: (with space) (these are the new LXD).
There are two main repositories with containers images, ubuntu: and images:. To see what’s in them, run lxc image list ubuntu: and lxc image list images:.
Similar problems here but I’m running on Debian (snap running lxd all on debian stretch running a debian stretch container).
root@debian-research1:~# ls -alh /etc/ssh/
total 576K
drwxr-xr-x 1 root root 294 Jun 2 23:09 .
drwxr-xr-x 1 root root 2.6K Jun 4 13:06 …
-rw-r–r-- 1 root root 541K Nov 18 2017 moduli
-rw-r–r-- 1 root root 1.7K Nov 18 2017 ssh_config
-rw------- 1 root root 227 Jun 2 23:09 ssh_host_ecdsa_key
-rw-r–r-- 1 root root 183 Jun 2 23:09 ssh_host_ecdsa_key.pub
-rw------- 1 root root 411 Jun 2 23:09 ssh_host_ed25519_key
-rw-r–r-- 1 root root 103 Jun 2 23:09 ssh_host_ed25519_key.pub
-rw------- 1 root root 1.7K Jun 2 23:09 ssh_host_rsa_key
-rw-r–r-- 1 root root 403 Jun 2 23:09 ssh_host_rsa_key.pub
-rw-r–r-- 1 root root 3.3K Mar 1 15:17 sshd_config
Not sure what’s causing the issues but on containers setup and started using lxd 2.xx I can used x2go to connect. Containers set up using lxd3.0 no dice - – absolutely can’t connect using x2go although I can connect using just ssh.