Skip to content

[BUG] O sistema retorna erro e sucesso na configuração de SSH #2

@schwenck-e

Description

@schwenck-e

Prerequisites

  • I have searched for existing issues and found none
  • I am using the latest version of erp-server-setup
  • I have read the documentation

Linux Distribution

Ubuntu 24.04 LTS (Noble)

Other Distribution

  • ubuntu (24.04.3 LTS (Noble Numbat))

Component Affected

SSH Configuration

📝 Description

Sistema retorna mensagem de erro e sucesso durante configuração do SSH, mas finaliza com confirmação de sucesso.

🔍 Steps to Reproduce

Baixe e execute o script:

wget https://github.com/eltongomez/server-setup/raw/main/erp-server-setup.sh
chmod +x erp-server-setup.sh
sudo ./erp-server-setup.sh

Escolha a opção 2:

MENU PRINCIPAL - Configuração do Servidor

  1. Configuração Completa (Recomendado)
  2. Segurança
  3. Monitoramento
  4. Backup
  5. Sistema
  6. Gerar Relatório
  7. Sair
  0. Voltar/Sair

Escolha a opção 1:

MENU DE SEGURANÇA

  1. Configurar SSH
  2. Configurar Firewall (UFW)
  3. Configurar Fail2Ban
  4. Política de Senhas
  5. Atualizações Automáticas
  6. Hardening do Kernel
  7. Voltar
  0. Voltar/Sair
Deseja configurar o SSH? [S/n]: s
[✓] Backup criado: sshd_config.backup-20251230-162339
Porta SSH [22]: 2222
Desabilitar login root via SSH? [S/n]: n
Desabilitar autenticação por senha (requer chave SSH)? [s/N]: n

✅ Expected Behavior

  • Deveria apresentar mensagem de sucesso ou de falha.

❌ Actual Behavior

  • Apresenta mensagem de erro e sucesso.

🚨 Error Messages

Failed to restart sshd.service: Unit sshd.service not found.
[✓] SSH configurado com sucesso na porta 2222

🖥️ Environment Information

Linux MACH-3 6.6.87.1-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 17:08:54 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Sudo version 1.9.15p5
Sudoers policy plugin version 1.9.15p5
Sudoers file grammar version 50
Sudoers I/O plugin version 1.9.15p5
Sudoers audit plugin version 1.9.15p5

📋 Relevant Logs

No response

📎 Additional Context

Image

Code of Conduct

  • I agree to follow the Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions