0

Currently, I'm investigating an issue with my container. I've got a Host with 2 Container which should be linked via Corosync. It's essential that these need to be connected with SSH for Corosync, but if I add normal users I can get the public key without a problem:

Here I try to copy the public key with a normal user

I want to get the Public key of my root, which I already generated with ssh-keygen and I used a passphrase, but if it tries to connect and I enter the passphrase while I want to copy the public key it says that mine is denied. This only occurs with the root user:

Here is the problem with my root

I really need help to fix that, i dont know why this happens...maybe he tries to use the root of my host machine, because i use lxc-attach to enter it.

Breedi
  • 75
  • 2
  • I found a solution. It seems to work just with a manual copy of the public key for a root user. ssh-copy-id won't work with a root user. Just enter /root/.ssh and search for id_rsa.pub, that's your public key, get the key with cat id_rsa.pub and copy it. Switch to the other container and enter /root/.ssh/ and create authorized_keys (with touch, vi or whatever) and add the public key there. Its essential to do that for both sides. – Breedi Dec 19 '17 at 02:50
  • or change the `/etc/ssh/sshd_conf` > `PermitRootLogin prohibit-password` to `PermitRootLogin yes` copy keys and then put it back after key copy. Its also lxc you can directly copy the keys or edit the `authorized_keys` from the host. `lxc file push ...` – Lawrence Cherone Dec 20 '17 at 02:04

0 Answers0