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 / computer / Perguntas / 1804868
Accepted
mazda
mazda
Asked: 2023-08-19 15:20:38 +0800 CST2023-08-19 15:20:38 +0800 CST 2023-08-19 15:20:38 +0800 CST

Por que o SSH não funciona se o WiFi estiver ativado enquanto a Ethernet estiver conectada?

  • 772

Tenho dois laptops [L1, L2] conectados à mesma caixa, ambos usando Debian 11:

  • L1: conectado via ethernet, placa wireless ligada
  • L2: conectado somente via WiFi

Com esta configuração, não consigo usar SSH para conectar L1 [cliente] a L2 [servidor], e se eu quiser usar SSH, tenho que desconectar o cabo ethernet de L1 ou desligar o WiFi de L1, e gostaria de entender o porquê :

  • Cliente:
    ~$ ip -brief addr
    
      lo               UNKNOWN        127.0.0.1/8 ::1/128
      enp1s0f1         UP             192.168.1.24/24 fe80::id1
      wlp2s0           UP             192.168.1.24/24 fe80::id2
    
    ~$ ssh -vvv [email protected]
    
      OpenSSH_8.4p1 Debian-5+deb11u1, OpenSSL 1.1.1n  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 *
    
      debug2: resolve_canonicalize: hostname 192.168.1.21 is address
      debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/xxx/.ssh/known_hosts'
      debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/xxx/.ssh/known_hosts2'
      debug2: ssh_connect_direct
    
      debug1: Connecting to 192.168.1.21 [192.168.1.21] port 22.
      debug1: connect to address 192.168.1.21 port 22: No route to host
    
      ssh: connect to host 192.168.1.21 port 22: No route to host
    

  • Servidor:
    ~# /usr/sbin/sshd -d
    
      debug1: sshd version OpenSSH_9.2, OpenSSL 3.0.9 30 May 2023
      debug1: private host key #0: ssh-rsa
      debug1: private host key #1: ecdsa-sha2-nistp256
      debug1: private host key #2: ssh-ed25519
    
      debug1: rexec_argv[0]='/usr/sbin/sshd'
      debug1: rexec_argv[1]='-d'
      debug1: Set /proc/self/oom_score_adj from 0 to -1000
    
      debug1: Bind to port 22 on 0.0.0.0.
      Server listening on 0.0.0.0 port 22.
      debug1: Bind to port 22 on ::.
      Server listening on :: port 22.
    
      debug1: Server will not fork when running in debugging mode.
      debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
    
      debug1: sshd version OpenSSH_9.2, OpenSSL 3.0.9 30 May 2023
      debug1: private host key #0: ssh-rsa SHA256:
      debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:
      debug1: private host key #2: ssh-ed25519 SHA256:
      debug1: inetd sockets after dupping: 3, 3
    
      Connection from 192.168.1.24 port 36154 on 192.168.1.21 port 22 rdomain ""
    
      debug1: Local version string SSH-2.0-OpenSSH_9.2p1 Debian-2
      debug1: Remote protocol version 2.0, remote software version OpenSSH_8.4p1 Debian-5+deb11u1
      debug1: compat_banner: match: OpenSSH_8.4p1 Debian-5+deb11u1 pat OpenSSH* compat 0x04000000
      debug1: permanently_set_uid: 115/65534 [preauth]
      debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
      debug1: SSH2_MSG_KEXINIT sent [preauth]
      debug1: SSH2_MSG_KEXINIT received [preauth]
      debug1: kex: algorithm: curve25519-sha256 [preauth]
      debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
      debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none [preauth]
      debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none [preauth]
      debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
      debug1: SSH2_MSG_KEX_ECDH_INIT received [preauth]
      debug1: rekey out after 134217728 blocks [preauth]
      debug1: SSH2_MSG_NEWKEYS sent [preauth]
      debug1: Sending SSH2_MSG_EXT_INFO [preauth]
      debug1: expecting SSH2_MSG_NEWKEYS [preauth]
      debug1: SSH2_MSG_NEWKEYS received [preauth]
      debug1: rekey in after 134217728 blocks [preauth]
      debug1: KEX done [preauth]
      debug1: userauth-request for user xxx  service ssh-connection method none [preauth]
      debug1: attempt 0 failures 0 [preauth]
      debug1: PAM: initializing for "xxx"
      debug1: PAM: setting PAM_RHOST to "192.168.1.24"
      debug1: PAM: setting PAM_TTY to "ssh"
      debug1: userauth_send_banner: sent [preauth]
      debug1: userauth-request for user xxx service ssh-connection method publickey [preauth]
    
      debug1: attempt 1 failures 0 [preauth]
      debug1: userauth_pubkey: publickey test pkalg rsa-sha2-512 pkblob RSA SHA256:[preauth]
      debug1: temporarily_use_uid: 1000/1000 (e=0/0)
      debug1: trying public key file /home/mi/.ssh/authorized_keys
      debug1: fd 4 clearing O_NONBLOCK
      debug1: /home/xxx/.ssh/authorized_keys:1: matching key found: RSA SHA256:
      debug1: /home/xxx/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
    
      Accepted key RSA SHA256: found at /home/xxx/.ssh/authorized_keys:1
      debug1: restore_uid: 0/0
    
      Postponed publickey for xxx from 192.168.1.24 port 36154 ssh2 [preauth]
    
      debug1: userauth-request for user xxx service ssh-connection method publickey [preauth]
      debug1: attempt 2 failures 0 [preauth]
      debug1: temporarily_use_uid: 1000/1000 (e=0/0)
      debug1: trying public key file /home/xxx/.ssh/authorized_keys
      debug1: fd 4 clearing O_NONBLOCK
      debug1: /home/xxx/.ssh/authorized_keys:1: matching key found: RSA SHA256:
      debug1: /home/xxx/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
    
      Accepted key RSA SHA256: found at /home/xxx/.ssh/authorized_keys:1
    
      debug1: restore_uid: 0/0
      debug1: auth_activate_options: setting new authentication options
      debug1: do_pam_account: called
    
      Accepted publickey for xxx from 192.168.1.24 port 36154 ssh2: RSA SHA256:
    
      debug1: monitor_child_preauth: user xxx authenticated by privileged process
      debug1: auth_activate_options: setting new authentication options [preauth]
      debug1: monitor_read_log: child log fd closed
      debug1: PAM: establishing credentials
    
      User child is on pid 2553
    
      debug1: SELinux support disabled
      debug1: PAM: establishing credentials
      debug1: permanently_set_uid: 1000/1000
      debug1: rekey in after 134217728 blocks
      debug1: rekey out after 134217728 blocks
      debug1: ssh_packet_set_postauth: called
      debug1: active: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
      debug1: Entering interactive session for SSH2.
      debug1: server_init_dispatch
      debug1: server_input_channel_open: ctype session rchan 0 win 1048576 max 16384
      debug1: input_session_request
      debug1: channel 0: new session [server-session] (inactive timeout: 0)
      debug1: session_new: session 0
      debug1: session_open: channel 0
      debug1: session_open: session 0: link with channel 0
      debug1: server_input_channel_open: confirm session
      debug1: server_input_global_request: rtype [email protected] want_reply 0
      debug1: server_input_channel_req: channel 0 request pty-req reply 1
      debug1: session_by_channel: session 0 channel 0
      debug1: session_input_channel_req: session 0 req pty-req
      debug1: Allocating pty.
      debug1: session_new: session 0
      debug1: SELinux support disabled
      debug1: session_pty_req: session 0 alloc /dev/pts/1
      debug1: server_input_channel_req: channel 0 request env reply 0
      debug1: session_by_channel: session 0 channel 0
      debug1: session_input_channel_req: session 0 req env
      debug1: server_input_channel_req: channel 0 request shell reply 1
      debug1: session_by_channel: session 0 channel 0
      debug1: session_input_channel_req: session 0 req shell
    
      Starting session: shell on pts/1 for xxx from 192.168.1.24 port 36154 id 0
    
linux
  • 1 1 respostas
  • 96 Views

1 respostas

  • Voted
  1. Best Answer
    dodrg
    2023-08-19T16:34:01+08:002023-08-19T16:34:01+08:00

    Resposta revisada após a pergunta ter sido atualizada pelos logs e configurações de rede:

    No cliente L1 , ambas as NICs, Ethernet e WiFi atribuíram o mesmo IP.
    Depois de atribuir IPs diferentes a eles, o problema desapareceu.


    Para obter logs de depuração:

    1. Saia de qualquer sessão SSH aberta
    2. Pare sshde reinicie-o com detalhamento de depuração:
      # Get the PID for sshd' and terminate it:
        ps ax | sudo sed -En 's|^\s*([0-9]+)\s.*/usr/sbin/ssh[d].*$|kill \1|pe'
      
      # Verify success (sshd processes should show up):
        ps ax | grep "ssh[d]"
      
      # Start sshd with debug option, then print output to screen and file:
        sudo /usr/sbin/sshd -d | tee your_debug.log
      
      
       # For debug verbosity on the client, call ssh with <-v || -vv || -vvv>:
         # -v: Debug1 || -vv: Debug2 | -vvv: Debug3:
           ssh -v <parameters>
      
    3. Com a depuração habilitada, sshdas saídas para o terminal eyour_debug.log
    • 1

relate perguntas

  • Como eu faria minha máquina Linux parecer que está executando o Windows?

  • Existe um equivalente a cd - para cp ou mv?

  • execute o contêiner do docker como root

  • Como ativar o sensor de impressão digital no domínio e no diretório ativo do Linux

  • Como alterar permanentemente Ctrl + C para Ctrl + K no CentOS 7?

Sidebar

Stats

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

    Como posso reduzir o consumo do processo `vmmem`?

    • 11 respostas
  • Marko Smith

    Baixar vídeo do Microsoft Stream

    • 4 respostas
  • Marko Smith

    O Google Chrome DevTools falhou ao analisar o SourceMap: chrome-extension

    • 6 respostas
  • Marko Smith

    O visualizador de fotos do Windows não pode ser executado porque não há memória suficiente?

    • 5 respostas
  • Marko Smith

    Como faço para ativar o WindowsXP agora que o suporte acabou?

    • 6 respostas
  • Marko Smith

    Área de trabalho remota congelando intermitentemente

    • 7 respostas
  • Marko Smith

    O que significa ter uma máscara de sub-rede /32?

    • 6 respostas
  • Marko Smith

    Ponteiro do mouse movendo-se nas teclas de seta pressionadas no Windows?

    • 1 respostas
  • Marko Smith

    O VirtualBox falha ao iniciar com VERR_NEM_VM_CREATE_FAILED

    • 8 respostas
  • Marko Smith

    Os aplicativos não aparecem nas configurações de privacidade da câmera e do microfone no MacBook

    • 5 respostas
  • Martin Hope
    Vickel O Firefox não permite mais colar no WhatsApp web? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke Por que os arquivos tar.xz são 15x menores ao usar a biblioteca tar do Python em comparação com o tar do macOS? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh Como posso reduzir o consumo do processo `vmmem`? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Pesquisa do Windows 10 não está carregando, mostrando janela em branco 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 Área de trabalho remota congelando intermitentemente 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney Por que colocar um ponto após o URL remove as informações de login? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension Ponteiro do mouse movendo-se nas teclas de seta pressionadas no Windows? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca Todos os meus complementos do Firefox foram desativados repentinamente, como posso reativá-los? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK É possível criar um código QR usando texto? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 Altere o nome da ramificação padrão do git init 2019-04-01 06:16:56 +0800 CST

Hot tag

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

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