Добрый день! Схема хостов следующая: на Windows 10 установлен virtualbox, на который прикручен Ubuntu server, на котором развёрнут контейнер (lxc). На сервере (Ubuntu server) и lxc установлен openssh-server.Создал ключи: [code]ssh-keygen[code].
Скопировал ключ: [code]ssh-copy-id paa@192.168.0.103[code]
Вошёл по ssh: [code]ssh -v paa@192.168.56.103[code]
Система выдала: [code]~$ ssh -v paa@192.168.56.103 OpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/.conf matched no files debug1: /etc/ssh/ssh_config line 21: Applying options for * debug1: Connecting to 192.168.56.103 [192.168.56.103] port 22. debug1: Connection established. debug1: identity file /home/paa/.ssh/id_rsa type 0 debug1: identity file /home/paa/.ssh/id_rsa-cert type -1 debug1: identity file /home/paa/.ssh/id_ecdsa type -1 debug1: identity file /home/paa/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/paa/.ssh/id_ecdsa_sk type -1 debug1: identity file /home/paa/.ssh/id_ecdsa_sk-cert type -1 debug1: identity file /home/paa/.ssh/id_ed25519 type -1 debug1: identity file /home/paa/.ssh/id_ed25519-cert type -1 debug1: identity file /home/paa/.ssh/id_ed25519_sk type -1 debug1: identity file /home/paa/.ssh/id_ed25519_sk-cert type -1 debug1: identity file /home/paa/.ssh/id_xmss type -1 debug1: identity file /home/paa/.ssh/id_xmss-cert type -1 debug1: identity file /home/paa/.ssh/id_dsa type -1 debug1: identity file /home/paa/.ssh/id_dsa-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.9p1 Ubuntu-3 debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubuntu-3 debug1: compat_banner: match: OpenSSH_8.9p1 Ubuntu-3 pat OpenSSH compat 0x04000000 debug1: Authenticating to 192.168.56.103:22 as ‘paa’ debug1: load_hostkeys: fopen /home/paa/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ssh-ed25519 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: SSH2_MSG_KEX_ECDH_REPLY received debug1: Server host key: ssh-ed25519 SHA256:7+bYI7Xh4NLxEEc40xmfja9/F2KtAJ+k8c7nOy2I8B4 debug1: load_hostkeys: fopen /home/paa/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: hostkeys_find_by_key_hostfile: hostkeys file /home/paa/.ssh/known_hosts2 does not exist debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts does not exist debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts2 does not exist The authenticity of host ‘192.168.56.103 (192.168.56.103)’ can’t be established. ED25519 key fingerprint is SHA256:7+bYI7Xh4NLxEEc40xmfja9/F2KtAJ+k8c7nOy2I8B4. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])?[code]
Т.е., приходится вводить пароль. Я иначе скопировал ключ: [code]~$ cat .ssh/id_rsa.pub | ssh paa@192.168.56.103 ‘cat >> .ssh/authorized_keys’[code].
Система ответила: [code]The authenticity of host ‘192.168.56.103 (192.168.56.103)’ can’t be established. ED25519 key fingerprint is SHA256:7+bYI7Xh4NLxEEc40xmfja9/F2KtAJ+k8c7nOy2I8B4. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Failed to add the host to the list of known hosts (/home/paa/.ssh/known_hosts). hostfile_replace_entries: link /home/paa/.ssh/known_hosts to /home/paa/.ssh/known_hosts.old: Operation not permitted update_known_hosts: hostfile_replace_entries failed for /home/paa/.ssh/known_hosts: Operation not permitted[code]. Проверил права на файл в контейнере: [code]s -l /home/paa/.ssh/known_hosts[code].
Права следующие: [code]-rwxr-xr-x 1 paa paa 978 Dec 20 15:47 /home/paa/.ssh/known_hosts[code].