Vagrant에서 Solaris11 열기: 127.0.0.1 포트 2222와 협상할 수 없습니다: 일치하는 호스트 키 유형을 찾을 수 없습니다. 인용문: ssh-rsa, ssh-dss

Vagrant에서 Solaris11 열기: 127.0.0.1 포트 2222와 협상할 수 없습니다: 일치하는 호스트 키 유형을 찾을 수 없습니다. 인용문: ssh-rsa, ssh-dss

나는 이 Vagrantfile을 사용합니다:

Vagrant.configure("2") do |config|

  config.vm.box = "jonatasbaldin/solaris11"
  config.vm.box_version = "1.0.0"
  
end

성공했지만 vagrant up255 vagrant ssh반환 코드로 종료되고 전혀 출력되지 않습니다. 디버깅을 위해 이렇게 합니다

$ ssh -v vagrant@localhost -p 2222

나는 얻다:

$ ssh -v vagrant@localhost -p 2222
OpenSSH_8.9p1 Ubuntu-3ubuntu0.1, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/mevatlave/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 267: Applying options for localhost
debug1: /etc/ssh/ssh_config line 288: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 2222.
debug1: Connection established.
debug1: identity file /home/mevatlave/.ssh/id_rsa type 0
debug1: identity file /home/mevatlave/.ssh/id_rsa-cert type -1
debug1: identity file /home/mevatlave/.ssh/id_ecdsa type -1
debug1: identity file /home/mevatlave/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/mevatlave/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/mevatlave/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/mevatlave/.ssh/id_ed25519 type -1
debug1: identity file /home/mevatlave/.ssh/id_ed25519-cert type -1
debug1: identity file /home/mevatlave/.ssh/id_ed25519_sk type -1
debug1: identity file /home/mevatlave/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/mevatlave/.ssh/id_xmss type -1
debug1: identity file /home/mevatlave/.ssh/id_xmss-cert type -1
debug1: identity file /home/mevatlave/.ssh/id_dsa type -1
debug1: identity file /home/mevatlave/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.1
debug1: Remote protocol version 2.0, remote software version Sun_SSH_2.2
debug1: compat_banner: no match: Sun_SSH_2.2
debug1: Authenticating to localhost:2222 as 'vagrant'
debug1: load_hostkeys: fopen /home/mevatlave/.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: diffie-hellman-group-exchange-sha256
debug1: kex: host key algorithm: (no match)
Unable to negotiate with 127.0.0.1 port 2222: no matching host key type found. Their offer: ssh-rsa,ssh-dss

온라인에서 많은 솔루션을 검색했지만 성공하지 못했습니다. 어떤 팁이 있나요?

내가 얻는 virtualbox tty에서sshd[1234]: fatal: no hostkey alg

답변1

SSH 프로토콜에는 다양한 유형의 키가 있으며 각각 하나 이상의 서명 알고리즘을 허용합니다. 서버 측에서 사용되는 키 유형은 RSA( ssh-rsa) 및 DSA( ssh-dss) 키입니다. RSA 키에는 ssh-rsa(SHA-1), rsa-sha2-256(SHA-256), rsa-sha2-512(SHA-512) 의 세 가지 서명이 있습니다 . 후자의 두 서명만 안전합니다. 이전 ssh-rsa서명 유형과 모든 서명은 ssh-dss더 이상 사용되지 않고 안전하지 않은 SHA-1을 사용합니다. (사용된 DSA 키의 크기도 현대 표준에 비하면 부적절합니다.)

안타깝게도 귀하가 사용하고 있는 가상 머신은 안전하지 않은 알고리즘만 지원하므로 안전하게 연결할 수 있는 방법이 없습니다. 가장 좋은 접근 방식은 다양한 이미지를 사용하여 보다 안전한 운영 체제 또는 보다 안전한 운영 체제 구성을 달성하는 것입니다.

반드시 이 이미지를 사용해야 하는 경우에는 ssh -o HostKeyAlgorithms=+ssh-rsa -p 2222 vagrant@localhost안전하지 않은 알고리즘이 활성화되도록 실행하여 ssh-rsa연결하시면 됩니다.

답변2

bk2204의 도움으로 내가 한 일:

존재하다 Vagrantfile:

  config.ssh.config = "ssh_config"
  config.vm.provision "shell", inline: <<-SHELL
  cat /path/to/.ssh/id_rsa.pub >> /export/home/vagrant/.ssh/authorized_keys
SHELL

존재하다 ssh_config;

User vagrant
HostKeyAlgorithms=+ssh-rsa
PubkeyAuthentication yes
IdentityFile /path/to/solaris/id_dsa

하지만 sshd 구성을 수정하더라도 키 쌍으로 로그인하는 것만으로는 충분하지 않습니다.

PasswordAuthentication no
PubkeyAuthentication yes

관련 정보