AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / unix / Perguntas / 736487
Accepted
Mévatlavé Kraspek
Mévatlavé Kraspek
Asked: 2023-02-23 00:14:05 +0800 CST2023-02-23 00:14:05 +0800 CST 2023-02-23 00:14:05 +0800 CST

Abra o Solaris11 no Vagrant: Não é possível negociar com 127.0.0.1 porta 2222: nenhum tipo de chave de host correspondente encontrado. Sua oferta: ssh-rsa,ssh-dss

  • 772

Eu uso este Vagrantfile:

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

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

O vagrant upé bem-sucedido, mas vagrant sshsai com o código de retorno 255 sem nenhuma saída. Para depurar, eu faço

$ ssh -v vagrant@localhost -p 2222

Eu recebo:

$ 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

Tentei muitas soluções de pesquisas na web sem sorte. Alguma dica?

No virtualbox tty, recebosshd[1234]: fatal: no hostkey alg

ssh
  • 2 2 respostas
  • 20 Views

2 respostas

  • Voted
  1. Best Answer
    bk2204
    2023-02-25T07:04:17+08:002023-02-25T07:04:17+08:00

    No protocolo SSH, existem diferentes tipos de chaves e cada tipo de chave permite um ou mais algoritmos de assinatura. O tipo de chave usado aqui no lado do servidor são as chaves RSA ( ssh-rsa) e DSA ( ssh-dss). Com chaves RSA, existem três tipos de assinaturas: ssh-rsa(SHA-1), rsa-sha2-256(SHA-256) e rsa-sha2-512(SHA-512). Apenas os dois últimos tipos de assinaturas são seguros; o ssh-rsatipo de assinatura mais antigo e todas as assinaturas para ssh-dssuso SHA-1, que é obsoleto e inseguro. (O tamanho das chaves DSA usadas também é totalmente inadequado para os padrões modernos.)

    Infelizmente, a VM que você está usando oferece suporte apenas a algoritmos inseguros, portanto, não há uma maneira segura de se conectar a ela. A melhor coisa a fazer é usar uma imagem diferente para um sistema operacional mais seguro ou uma configuração mais segura do sistema operacional.

    Se você absolutamente precisar usar esta imagem, poderá executá-la ssh -o HostKeyAlgorithms=+ssh-rsa -p 2222 vagrant@localhostpara ativar o ssh-rsaalgoritmo inseguro e conectar-se.

    • 1
  2. Mévatlavé Kraspek
    2023-02-26T04:28:01+08:002023-02-26T04:28:01+08:00

    O que fiz com a ajuda do bk2204:

    Em 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
    

    Em ssh_config;

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

    Mas não é suficiente fazer login com o par de chaves, mesmo que eu modifique a configuração do sshd:

    PasswordAuthentication no
    PubkeyAuthentication yes
    
    • 0

relate perguntas

  • Por que o utilitário ssh é considerado um pty?

  • Auto-SSH funciona manualmente, mas não em segundo plano

  • Execute o aplicativo X remotamente, execute a GUI no host remoto [fechado]

  • rsync porta 22 e 873 uso

  • Aborto repentino do SCP: tubo quebrado, código de autenticação de mensagem incorreto

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Possível firmware ausente /lib/firmware/i915/* para o módulo i915

    • 3 respostas
  • Marko Smith

    Falha ao buscar o repositório de backports jessie

    • 4 respostas
  • Marko Smith

    Como exportar uma chave privada GPG e uma chave pública para um arquivo

    • 4 respostas
  • Marko Smith

    Como podemos executar um comando armazenado em uma variável?

    • 5 respostas
  • Marko Smith

    Como configurar o systemd-resolved e o systemd-networkd para usar o servidor DNS local para resolver domínios locais e o servidor DNS remoto para domínios remotos?

    • 3 respostas
  • Marko Smith

    apt-get update error no Kali Linux após a atualização do dist [duplicado]

    • 2 respostas
  • Marko Smith

    Como ver as últimas linhas x do log de serviço systemctl

    • 5 respostas
  • Marko Smith

    Nano - pule para o final do arquivo

    • 8 respostas
  • Marko Smith

    erro grub: você precisa carregar o kernel primeiro

    • 4 respostas
  • Marko Smith

    Como baixar o pacote não instalá-lo com o comando apt-get?

    • 7 respostas
  • Martin Hope
    user12345 Falha ao buscar o repositório de backports jessie 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl Por que a maioria dos exemplos do systemd contém WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky Como exportar uma chave privada GPG e uma chave pública para um arquivo 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll status systemctl mostra: "Estado: degradado" 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim Como podemos executar um comando armazenado em uma variável? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S Por que /dev/null é um arquivo? Por que sua função não é implementada como um programa simples? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 Como ver as últimas linhas x do log de serviço systemctl 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - pule para o final do arquivo 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla Por que verdadeiro e falso são tão grandes? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis Substitua a string em um arquivo de texto enorme (70 GB), uma linha 2017-12-30 06:58:33 +0800 CST

Hot tag

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve