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 / ubuntu / Perguntas / 1161579
Accepted
Alan
Alan
Asked: 2019-07-28 17:48:50 +0800 CST2019-07-28 17:48:50 +0800 CST 2019-07-28 17:48:50 +0800 CST

O servidor SSH não pode ser encontrado - mesmo instalado

  • 772

Eu tenho uma máquina executando o Ubuntu 18.04 LTS, onde não consigo fazer o servidor SSH funcionar.

Eu instalei o SSHServer usando:

sudo apt install openssh-server

mas estou recebendo o seguinte quando tento iniciar e/ou verificar o status:

sudo systemctl start sshd

Failed to start sshd.service: Unit sshd.service not found.

.

sudo systemctl status sshd

Unit sshd.service could not be found.

Achei que deveria ter feito algo errado (erro de digitação?) quando instalei, então tentei instalar novamente assim:

sudo apt install openssh-server

ao qual recebo:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
openssh-server is already the newest version (1:7.6p1-4ubuntu0.3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Então, parece que está instalado, mas por algum motivo o Ubuntu não consegue encontrá-lo.

Não tenho certeza para onde ir a partir daqui, então qualquer sugestão seria bem-vinda.

Obrigado,

Alan.

ssh openssh sshd
  • 2 2 respostas
  • 35633 Views

2 respostas

  • Voted
  1. Best Answer
    Nic Wanavit
    2019-07-28T20:12:07+08:002019-07-28T20:12:07+08:00

    É possível que o serviço não seja chamado sshd. você pode tentar este comando

    systemctl -l --type service --all|grep ssh
    

    No meu Ubuntu 18.04, o serviço é chamado ssh por padrão.

    no meu caso fiz

    sudo systemctl start ssh
    

    Se isso não resolver seu problema, você pode reinstalar o ssh

    sudo apt-get remove --purge openssh-server
    sudo apt-get update
    sudo apt-get install openssh-server
    
    • 8
  2. Alan
    2019-07-28T21:58:27+08:002019-07-28T21:58:27+08:00
    systemctl -l --type service --all|grep ssh
    

    não retornou nada, então eu removi e reinstalei como você sugeriu.

    Eu também reiniciei após a reinstalação apenas por precaução (eu reiniciei antes, mas não ajudou). Parece estar tudo bem agora. Se eu tentar esse comando novamente, recebo:

    ssh.service    loaded    active   running OpenBSD Secure Shell server
    

    e se eu executar:

    sudo systemctl status sshd
    

    Eu recebo:

    ● ssh.service - OpenBSD Secure Shell server
    Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
    Active: active (running) since Sun 2019-07-28 17:46:39 NZST; 1min 7s ago
    Process: 1343 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
    Process: 1337 ExecReload=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
    Process: 1151 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
    Main PID: 1166 (sshd)
    Tasks: 1 (limit: 4915)
    CGroup: /system.slice/ssh.service
           └─1166 /usr/sbin/sshd -D
    
    Jul 28 17:46:37 Ubuntu-12345 systemd[1]: Starting OpenBSD Secure Shell server...
    Jul 28 17:46:39 Ubuntu-12345 sshd[1166]: Server listening on 0.0.0.0 port 22.
    Jul 28 17:46:39 Ubuntu-12345 systemd[1]: Started OpenBSD Secure Shell server.
    Jul 28 17:46:39 Ubuntu-12345 sshd[1166]: Server listening on :: port 22.
    Jul 28 17:46:45 Ubuntu-12345 systemd[1]: Reloading OpenBSD Secure Shell server.
    Jul 28 17:46:45 Ubuntu-12345 sshd[1166]: Received SIGHUP; restarting.
    Jul 28 17:46:45 Ubuntu-12345 systemd[1]: Reloaded OpenBSD Secure Shell server.
    Jul 28 17:46:45 Ubuntu-12345 sshd[1166]: Server listening on 0.0.0.0 port 22.
    Jul 28 17:46:45 Ubuntu-12345 sshd[1166]: Server listening on :: port 22.
    

    Então parece estar tudo bem agora - pelo menos até onde eu posso dizer.

    Obrigado,

    Alan.

    • 4

relate perguntas

  • Como interagir graficamente com um servidor sem cabeça?

Sidebar

Stats

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

    Existe um comando para listar todos os usuários? Também para adicionar, excluir, modificar usuários, no terminal?

    • 9 respostas
  • Marko Smith

    Como excluir um diretório não vazio no Terminal?

    • 4 respostas
  • Marko Smith

    Como descompactar um arquivo zip do Terminal?

    • 9 respostas
  • Marko Smith

    Como instalo um arquivo .deb por meio da linha de comando?

    • 11 respostas
  • Marko Smith

    Como instalo um arquivo .tar.gz (ou .tar.bz2)?

    • 14 respostas
  • Marko Smith

    Como listar todos os pacotes instalados

    • 24 respostas
  • Martin Hope
    Flimm Como posso usar o docker sem sudo? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    led-Zepp Como faço para salvar a saída do terminal em um arquivo? 2014-02-15 11:49:07 +0800 CST
  • Martin Hope
    ubuntu-nerd Como descompactar um arquivo zip do Terminal? 2011-12-11 20:37:54 +0800 CST
  • Martin Hope
    TheXed Como instalo um arquivo .deb por meio da linha de comando? 2011-05-07 09:40:28 +0800 CST
  • Martin Hope
    Ivan Como listar todos os pacotes instalados 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    David Barry Como determino o tamanho total de um diretório (pasta) na linha de comando? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher "Os seguintes pacotes foram retidos:" Por que e como resolvo isso? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford Como os PPAs podem ser removidos? 2010-07-30 01:09:42 +0800 CST

Hot tag

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

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