Добрый день, сел изучать администрирование ubuntu и столкнулся с такой проблемой:
При настройке SFTP (по мануале настраивал ssh и sftp) на шаге перезапуска SSH столкнулся с проблемой Job for ssh.service failed because the control process exited with error code. See «systemctl status ssh.service» and «journalctl -xe» for details.. Вот запись из лога «journalctl -xe».
Кто-нибудь сталкивался с такой проблемой? Заранее большое спасибо.
Sep 05 18:06:11 Ubuntu-1604-xenial-64-minimal systemd[1]: ssh.service: Failed with result ‘exit-code’.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: Reloading.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: apt-daily.timer: Adding 9h 28min 21.099122s random time.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: Reloading.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: apt-daily.timer: Adding 6h 55min 6.176419s random time.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: Stopped OpenBSD Secure Shell server.
— Subject: Unit ssh.service has finished shutting down
— Defined-By: systemd
— Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit ssh.service has finished shutting down.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: Starting OpenBSD Secure Shell server…
— Subject: Unit ssh.service has begun start-up
— Defined-By: systemd
— Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit ssh.service has begun starting up.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal sshd[12464]: /etc/ssh/sshd_config line 96: Directive ‘UsePAM’ is not allowed within a Match block
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: Failed to start OpenBSD Secure Shell server.
— Subject: Unit ssh.service has failed
— Defined-By: systemd
— Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit ssh.service has failed.
—
— The result is failed.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: ssh.service: Unit entered failed state.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: ssh.service: Failed with result ‘exit-code’.
Sep 05 18:06:16 Ubuntu-1604-xenial-64-minimal sudo[11661]: pam_unix(sudo:session): session closed for user root
Sep 05 18:06:47 Ubuntu-1604-xenial-64-minimal sudo[12475]: root : TTY=pts/2 ; PWD=/root ; USER=root ; COMMAND=/bin/nano /etc/ssh/sshd_config
Sep 05 18:06:47 Ubuntu-1604-xenial-64-minimal sudo[12475]: pam_unix(sudo:session): session opened for user root by root(uid=0)
Sep 05 18:08:07 Ubuntu-1604-xenial-64-minimal sudo[12475]: pam_unix(sudo:session): session closed for user root
Sep 05 18:08:10 Ubuntu-1604-xenial-64-minimal sudo[12477]: root : TTY=pts/2 ; PWD=/root ; USER=root ; COMMAND=/usr/sbin/service ssh restart
Sep 05 18:08:10 Ubuntu-1604-xenial-64-minimal sudo[12477]: pam_unix(sudo:session): session opened for user root by root(uid=0)
Sep 05 18:08:10 Ubuntu-1604-xenial-64-minimal systemd[1]: Stopped OpenBSD Secure Shell server.
— Subject: Unit ssh.service has finished shutting down
— Defined-By: systemd
— Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit ssh.service has finished shutting down.
Sep 05 18:08:10 Ubuntu-1604-xenial-64-minimal systemd[1]: Starting OpenBSD Secure Shell server…
— Subject: Unit ssh.service has begun start-up
— Defined-By: systemd
— Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit ssh.service has begun starting up.
Sep 05 18:08:10 Ubuntu-1604-xenial-64-minimal sshd[12484]: /etc/ssh/sshd_config line 101: Directive ‘UsePAM’ is not allowed within a Match block
Sep 05 18:08:10 Ubuntu-1604-xenial-64-minimal systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
Sep 05 18:08:10 Ubuntu-1604-xenial-64-minimal sudo[12477]: pam_unix(sudo:session): session closed for user root
Sep 05 18:08:10 Ubuntu-1604-xenial-64-minimal systemd[1]: Failed to start OpenBSD Secure Shell server.
— Subject: Unit ssh.service has failed
— Defined-By: systemd
— Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit ssh.service has failed.
—
— The result is failed.
Sep 05 18:08:10 Ubuntu-1604-xenial-64-minimal systemd[1]: ssh.service: Unit entered failed state.
Sep 05 18:08:10 Ubuntu-1604-xenial-64-minimal systemd[1]: ssh.service: Failed with result ‘exit-code’.
Sep 05 18:17:01 Ubuntu-1604-xenial-64-minimal CRON[12492]: pam_unix(cron:session): session opened for user root by (uid=0)
Sep 05 18:17:01 Ubuntu-1604-xenial-64-minimal CRON[12493]: (root) CMD ( cd / && run-parts —report /etc/cron.hourly)
Sep 05 18:17:01 Ubuntu-1604-xenial-64-minimal CRON[12492]: pam_unix(cron:session): session closed for user root
Sep 05 18:25:40 Ubuntu-1604-xenial-64-minimal sudo[12497]: root : TTY=pts/2 ; PWD=/root ; USER=root ; COMMAND=/usr/sbin/service ssh restart
Sep 05 18:25:40 Ubuntu-1604-xenial-64-minimal sudo[12497]: pam_unix(sudo:session): session opened for user root by root(uid=0)
Sep 05 18:25:40 Ubuntu-1604-xenial-64-minimal systemd[1]: Stopped OpenBSD Secure Shell server.
— Subject: Unit ssh.service has finished shutting down
— Defined-By: systemd
— Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit ssh.service has finished shutting down.
Sep 05 18:25:40 Ubuntu-1604-xenial-64-minimal systemd[1]: Starting OpenBSD Secure Shell server…
— Subject: Unit ssh.service has begun start-up
— Defined-By: systemd
— Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit ssh.service has begun starting up.
Sep 05 18:25:41 Ubuntu-1604-xenial-64-minimal sshd[12504]: /etc/ssh/sshd_config line 101: Directive ‘UsePAM’ is not allowed within a Match block
Sep 05 18:25:41 Ubuntu-1604-xenial-64-minimal systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
Sep 05 18:25:41 Ubuntu-1604-xenial-64-minimal sudo[12497]: pam_unix(sudo:session): session closed for user root
Sep 05 18:25:41 Ubuntu-1604-xenial-64-minimal systemd[1]: Failed to start OpenBSD Secure Shell server.
— Subject: Unit ssh.service has failed
— Defined-By: systemd
— Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit ssh.service has failed.
—
— The result is failed.
Sep 05 18:25:41 Ubuntu-1604-xenial-64-minimal systemd[1]: ssh.service: Unit entered failed state.
Sep 05 18:25:41 Ubuntu-1604-xenial-64-minimal systemd[1]: ssh.service: Failed with result ‘exit-code’.
lines 1364-1453/1453 (END)
Sep 05 18:06:11 Ubuntu-1604-xenial-64-minimal systemd[1]: ssh.service: Failed with result ‘exit-code’.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: Reloading.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: apt-daily.timer: Adding 9h 28min 21.099122s random time.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: Reloading.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: apt-daily.timer: Adding 6h 55min 6.176419s random time.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: Stopped OpenBSD Secure Shell server.
— Subject: Unit ssh.service has finished shutting down
— Defined-By: systemd
— Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit ssh.service has finished shutting down.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: Starting OpenBSD Secure Shell server…
— Subject: Unit ssh.service has begun start-up
— Defined-By: systemd
— Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit ssh.service has begun starting up.
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal sshd[12464]: /etc/ssh/sshd_config line 96: Directive ‘UsePAM’ is not allowed within a Match block
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
Sep 05 18:06:13 Ubuntu-1604-xenial-64-minimal systemd[1]: Failed to start OpenBSD Secure Shell server.
— Subject: Unit ssh.service has failed
— Defined-By: systemd
— Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit ssh.service has failed.
-
Вопрос заданболее трёх лет назад
-
10831 просмотр
Пригласить эксперта
Ну так оно же вам пишет, что проблем а конфиге
/etc/ssh/sshd_config line 96: Directive 'UsePAM' is not allowed within a Match block
Директива UsePAM стоит не в том месте, ошибка в строчке 96.
-
Показать ещё
Загружается…
09 февр. 2023, в 23:14
1500 руб./за проект
09 февр. 2023, в 23:00
1500 руб./за проект
09 февр. 2023, в 22:06
500 руб./за проект
Минуточку внимания
- Печать
Страницы: [1] Вниз
Тема: Не запускается демон ssh (Прочитано 12826 раз)
0 Пользователей и 1 Гость просматривают эту тему.
GrandLamer
Всем привет! При вводе команды в терминале
sudo service ssh start
в ответ получаю это:
Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details.
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enab
Active: failed (Result: exit-code) since Пт 2017-03-03 21:49:44 +07; 50s ago
Process: 1857 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCES
Process: 5498 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255)
Main PID: 5498 (code=exited, status=255)
мар 03 21:49:44 PC systemd[1]: Starting OpenBSD Secure Shell server...
мар 03 21:49:44 PC systemd[1]: ssh.service: Main process exited, code=exited, st
мар 03 21:49:44 PC systemd[1]: Failed to start OpenBSD Secure Shell server.
мар 03 21:49:44 PC systemd[1]: ssh.service: Unit entered failed state.
мар 03 21:49:44 PC systemd[1]: ssh.service: Failed with result 'exit-code'.
alex@PC:~$ journalctl -xe
Делал всё по мануалу: https://help.ubuntu.ru/wiki/ssh
мар 03 21:49:43 PC sudo[5466]: pam_ecryptfs: pam_sm_authenticate: /home/alex is
мар 03 21:49:43 PC sudo[5466]: alex : TTY=pts/5 ; PWD=/home/alex ; USER=root
мар 03 21:49:43 PC sudo[5466]: pam_unix(sudo:session): session opened for user r
мар 03 21:49:44 PC systemd[1]: Starting OpenBSD Secure Shell server...
-- Subject: Начинается запуск юнита ssh.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Начат процесс запуска юнита ssh.service.
мар 03 21:49:44 PC sshd[5498]: error: Bind to port 443 on 192.168.100.3 failed:
мар 03 21:49:44 PC sshd[5498]: fatal: Cannot bind any address.
мар 03 21:49:44 PC systemd[1]: ssh.service: Main process exited, code=exited, st
мар 03 21:49:44 PC systemd[1]: Failed to start OpenBSD Secure Shell server.
-- Subject: Ошибка юнита ssh.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Произошел сбой юнита ssh.service.
--
-- Результат: failed.
мар 03 21:49:44 PC systemd[1]: ssh.service: Unit entered failed state.
мар 03 21:49:44 PC systemd[1]: ssh.service: Failed with result 'exit-code'.
мар 03 21:49:44 PC sudo[5466]: pam_unix(sudo:session): session closed for user r
Port 443, ListenAddress 192.168.100.3:443
Что означает fatal: Cannot bind any address и как мне запустить ssh? (P.S.-Пока учусь, просьба тапками не бросаться)
« Последнее редактирование: 03 Марта 2017, 17:52:29 от GrandLamer »
SABeShnik
2x2Gb DDRIII, C2D8400, Seagate 2x2Tb 5900, Samsung 1Tb 7200,
Seagate 250 7200, X633, AeroCool 700W
Heider
bezbo
error: Bind to port 443 on 192.168.100.3 failed
https?
Heider
bezbo, кстати, да. GrandLamer, а вебсервер на этой машине не крутится случайно? Может быть, у Вас конфликт портов.
Punko
GrandLamer, этож зачем перевешывать на другой стандартный порт? Оо
Вешай от 1024 до 30000.
Или вообще оставь дефолт -22, но убери доступ по паролю и доступ для рута.
GrandLamer
Heider, выхлоп аналогичен
bezbo, Heider, сам никаких вебсерверов не запускал. Менял порт, толку 0
Punko, и на стандартном порту, и на поту от 1024 до 30000, всё также, только в логе меняется этот самый порт
Может быть, поломал ssh, не заметив Скопипастил пример конфигурации open-ssh сервера с русскими комментариями, выключил заход под рутом, включил IPv4, отключил пароль, включил ключи. Может быть пакет purge`ом покалечил
« Последнее редактирование: 04 Марта 2017, 08:43:19 от GrandLamer »
Heider
GrandLamer, ну так снеси пакет вместе с конфигами и установи по новой. А вообще, заведи привычку перед правкой конфига делать:
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.origin
И чужие конфиги лучше не копировать, а править в своем, при этом делать комментарий, что за правка и зачем она, через полгода забудешь все.
GrandLamer
Помогла переустановка пакетов openssh и ssh. Всем спасибо за помощь!
Видимо, проблема была в ListenAddress. Наверное, я не так понял назначение этой строчки. Это ip, которое надо буде вводить в клиенте?
« Последнее редактирование: 04 Марта 2017, 10:43:00 от GrandLamer »
ConnaiSSant
Помогла переустановка пакетов openssh и ssh. Всем спасибо за помощь!
Видимо, проблема была в ListenAddress. Наверное, я не так понял назначение этой строчки. Это ip, которое надо буде вводить в клиенте?
В ListenAddress указывается IP адрес того интерфейса, который будет прослушиваться демоном. Если хотите, чтобы прослушивать все интерфейсы (если их 2 и более) то оставьте строку за комментарием. Например:
grep «Listen» /etc/ssh/sshd_config
#ListenAddress 0.0.0.0 ///IPv4
#ListenAddress :: ///IPv6
- Печать
Страницы: [1] Вверх
Собственно, вот:
host-15 ~ # service sshd start
Job for sshd.service failed because the control process exited with error code.
See "systemctl status sshd.service" and "journalctl -xe" for details.
host-15 ~ # journalctl -xe
-- Произошел сбой юнита sshd.service.
--
-- Результат: failed.
дек 15 11:25:55 host-15.localdomain systemd[1]: sshd.service: Unit entered failed state.
дек 15 11:25:55 host-15.localdomain systemd[1]: sshd.service: Failed with result 'exit-code'.
дек 15 11:25:55 host-15.localdomain systemd[1]: sshd.service: Service hold-off time over, scheduling restart.
дек 15 11:25:55 host-15.localdomain systemd[1]: Stopped OpenSSH server daemon.
-- Subject: Завершена остановка юнита sshd.service.
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Процесс остановки юнита sshd.service был завершен.
дек 15 11:25:55 host-15.localdomain systemd[1]: sshd.service: Start request repeated too quickly.
дек 15 11:25:55 host-15.localdomain systemd[1]: Failed to start OpenSSH server daemon.
-- Subject: Ошибка юнита sshd.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Произошел сбой юнита sshd.service.
--
-- Результат: failed.
дек 15 11:25:55 host-15.localdomain systemd[1]: sshd.service: Unit entered failed state.
дек 15 11:25:55 host-15.localdomain systemd[1]: sshd.service: Failed with result 'start-limit-hit'.
host-15 ~ # systemctl status sshd.service
● sshd.service - OpenSSH server daemon
Loaded: loaded (/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: failed (Result: start-limit-hit) since Чт 2016-12-15 11:25:55 MSK; 48s ago
Process: 4004 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=1/FAILURE)
Process: 4000 ExecStartPre=/usr/bin/ssh-keygen -A (code=exited, status=0/SUCCESS)
дек 15 11:25:55 host-15.localdomain systemd[1]: sshd.service: Control process exited, code=exited status=1
дек 15 11:25:55 host-15.localdomain systemd[1]: Failed to start OpenSSH server daemon.
дек 15 11:25:55 host-15.localdomain systemd[1]: sshd.service: Unit entered failed state.
дек 15 11:25:55 host-15.localdomain systemd[1]: sshd.service: Failed with result 'exit-code'.
дек 15 11:25:55 host-15.localdomain systemd[1]: sshd.service: Service hold-off time over, scheduling restart.
дек 15 11:25:55 host-15.localdomain systemd[1]: Stopped OpenSSH server daemon.
дек 15 11:25:55 host-15.localdomain systemd[1]: sshd.service: Start request repeated too quickly.
дек 15 11:25:55 host-15.localdomain systemd[1]: Failed to start OpenSSH server daemon.
дек 15 11:25:55 host-15.localdomain systemd[1]: sshd.service: Unit entered failed state.
дек 15 11:25:55 host-15.localdomain systemd[1]: sshd.service: Failed with result 'start-limit-hit'.
host-15 ~ #
Как можно исправить?
Установленные пакеты:
host-15 ~ # rpm -qa 'openssh-*'
openssh-askpass-common-7.2p2-alt2
openssh-clients-7.2p2-alt2
openssh-keysign-7.2p2-alt2
openssh-server-7.2p2-alt2
openssh-server-control-7.2p2-alt2
openssh-common-7.2p2-alt2
host-15 ~ #
Система:
host-15 ~ # rpm -qa 'openssh-*'
openssh-askpass-common-7.2p2-alt2
openssh-clients-7.2p2-alt2
openssh-keysign-7.2p2-alt2
openssh-server-7.2p2-alt2
openssh-server-control-7.2p2-alt2
openssh-common-7.2p2-alt2
host-15 ~ #
Куда вешать багу?
Записан
А разве у ssh есть unit?
Он должен подниматься через демон SYSV
Записан
Руслан, есть unit-файл. А здесь, похоже, стукнулся в лимиты, как и написано.
Записан
Андрей Черепанов (cas@)
Запустите с отладкой:
/usr/sbin/sshd -Dde
Записан
Андрей Черепанов (cas@)
Вот результат отладки.
Похоже, что при первом запуске не сгенерировались ключи:
host-15 ~ # /usr/sbin/sshd -Dde
debug1: sshd version OpenSSH_7.2, OpenSSL 1.0.2j 26 Sep 2016
debug1: key_load_private: incorrect passphrase supplied to decrypt private key
sshd: key_load_public: invalid format
sshd: Could not load host key: /etc/openssh/ssh_host_rsa_key
debug1: key_load_private: incorrect passphrase supplied to decrypt private key
sshd: key_load_public: invalid format
sshd: Could not load host key: /etc/openssh/ssh_host_dsa_key
debug1: key_load_private: incorrect passphrase supplied to decrypt private key
sshd: key_load_public: invalid format
sshd: Could not load host key: /etc/openssh/ssh_host_ecdsa_key
debug1: key_load_private: incorrect passphrase supplied to decrypt private key
sshd: key_load_public: invalid format
sshd: Could not load host key: /etc/openssh/ssh_host_ed25519_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.
host-15 ~ #
И как это исправить?
Записан
Сам спросил, сам ответил:
1. Оказалось, что в /etc/openssh файлы ssh_host_* имеют длину 0
2. Удалил все эти неправильные файлы
например
host-15 ~ # rm /etc/openssh/ssh_host*
3. Затем ключи генерируются вручную (при запросе пароля просто следует нажать ENTER и при подтверждении пароля тоже)
Последовательность команд:
host-15 ~ # ssh-keygen -t dsa -f /etc/openssh/ssh_host_dsa_key
host-15 ~ # ssh-keygen -t ecdsa -f /etc/openssh/ssh_host_ecdsa_key
host-15 ~ # ssh-keygen -t ed25519 -f /etc/openssh/ssh_host_ed25519_key
host-15 ~ # ssh-keygen -t rsa -f /etc/openssh/ssh_host_rsa_key
После этих танцев с бубном все работает.
Записан
Записан
Андрей Черепанов (cas@)
Спасибо за подсказки!
Однако было бы, наверное, лучше, если бы ключи корректно генерировались сразу.
В дистрибутивах p7 и в системах обновленных с p7 до p8 таких эффектов не наблюдал (правда, «Школьный» использовал только сервер).
Записан
Спасибо за подсказки!
Однако было бы, наверное, лучше, если бы ключи корректно генерировались сразу.
В дистрибутивах p7 и в системах обновленных с p7 до p8 таких эффектов не наблюдал (правда, «Школьный» использовал только сервер).
Они и так генерируются сразу. Ни разу не встречал, чтобы openssh не запускался.
Записан
Андрей Черепанов (cas@)
Ни разу не встречал, чтобы openssh не запускался.
Из коробки или вообще?
Если вообще, то я убивал его, когда возился с модулем для альтератора: после одного из экспериментов был поврежден конфиг (я так и не понял, где и как, т.к. все строки совпадали). Вылечилось восстановлением конфига из бэкапа.
Записан
Вообще. Но я экспериментов и не устраивал.
Записан
Андрей Черепанов (cas@)
Это в виртуалке (virtualbox под ALT/p7 и ALT/p8)
Вообще в виртуалке поведение дистрибутивов непредсказуемо — то сетевой интерфейс в vboxnet0 не понимается, то сервисы не стартуют…
Испытывал на «Школьный сервер 7.03» и вот сейчас «Образование 8.1».
Записан
Introduction
The title of this article is the focus on the content. It is a problem on remote accessing server using ssh command. Another article in this link provides detail description about the factor causing the problem. In this case, a server remote process using ssh command suddenly failed. It happens because of the package removal process. It erase libgomp and nss-softokn-freebl package using yum utility command. The remote process just stop without any further progress. Terminating the is the only option after waiting for too long. It shows as follows :
user@hostname:~$ ssh myuser@xxx.xxx.xxx.xxx ^C user@hostname:~$
Assessing the current situation
Fortunately, before the sshd service stop working, there is one active terminal connecting to the remote server. To be able to grasp the root cause of the problem, check the status of the sshd service :
[root@localhost nspr]# systemctl status sshd ● sshd.service - OpenSSH server daemon Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2018-07-16 09:30:49; xx months xx days ago Docs: man:sshd(8) man:sshd_config(5) Main PID: 10481 (sshd) CGroup: /system.slice/sshd.service └─10481 /usr/sbin/sshd -D Feb 04 07:36:55 localhost.localdomain sshd[19128]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "xxxxxx" Feb 04 07:36:57 localhost.localdomain sshd[19128]: Failed password for xxxxxx from xxx.xxx.xxx.xxx port xxxxxx ssh2 Feb 04 07:36:57 localhost.localdomain sshd[19128]: Connection closed by xxx.xxx.xxx.xxx port 42480 [preauth] Feb 04 07:36:57 localhost.localdomain sshd[19128]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxx.xxx.xxx.xxx user=xxxxxx Feb 04 07:37:00 localhost.localdomain sshd[19133]: Accepted password for xxxxxx from xxx.xxx.xxx.xxx port 42486 ssh2 Feb 04 08:27:47 localhost.localdomain sshd[10481]: /usr/sbin/sshd: error while loading shared libraries: libfreebl3.so: cannot open shared object file: No such file or directory Feb 04 08:29:34 localhost.localdomain sshd[10481]: /usr/sbin/sshd: error while loading shared libraries: libfreebl3.so: cannot open shared object file: No such file or directory Feb 04 08:31:01 localhost.localdomain sshd[10481]: /usr/sbin/sshd: error while loading shared libraries: libfreebl3.so: cannot open shared object file: No such file or directory Feb 04 08:31:28 localhost.localdomain sshd[10481]: /usr/sbin/sshd: error while loading shared libraries: libfreebl3.so: cannot open shared object file: No such file or directory Feb 04 08:31:47 localhost.localdomain sshd[10481]: /usr/sbin/sshd: error while loading shared libraries: libfreebl3.so: cannot open shared object file: No such file or directory [root@localhost nspr]#
Attempt to execute the solution
Unfortunately, restarting the sshd service for a solution is helpless. The execution command for restarting the sshd service fails as follows :
[root@localhost ~]# systemctl restart sshd Job for sshd.service failed because the control process exited with error code. See "systemctl status sshd.service" and "journalctl -xe" for details. [root@localhost ~]#
Another additional information regarding the log of the ssh service status after restarting it exists below :
[root@localhost mnt]# systemctl status sshd ● sshd.service - OpenSSH server daemon Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Mon 2019-02-04 09:03:53; 5s ago Docs: man:sshd(8) man:sshd_config(5) Process: 22653 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=127) Main PID: 22653 (code=exited, status=127) Feb 04 09:03:53 localhost.localdomain systemd[1]: Failed to start OpenSSH server daemon. Feb 04 09:03:53 localhost.localdomain systemd[1]: Unit sshd.service entered failed state. Feb 04 09:03:53 localhost.localdomain systemd[1]: sshd.service failed. [root@localhost mnt]# journalctl -xe Feb 04 09:03:03 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:13 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:13 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:13 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:13 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:23 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:23 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:24 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:24 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:34 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:34 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:34 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:34 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:44 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:44 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:44 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:44 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:52 localhost.localdomain polkitd[821]: Registered Authentication Agent for unix-process:22644:1753845907 (system bus name :1.11011 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path Feb 04 09:03:52 localhost.localdomain systemd[1]: Stopping OpenSSH server daemon... -- Subject: Unit sshd.service has begun shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit sshd.service has begun shutting down. Feb 04 09:03:52 localhost.localdomain sshd[10481]: Received signal 15; terminating. Feb 04 09:03:53 localhost.localdomain systemd[1]: Starting OpenSSH server daemon... -- Subject: Unit sshd.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit sshd.service has begun starting up. Feb 04 09:03:53 localhost.localdomain sshd[22653]: /usr/sbin/sshd: error while loading shared libraries: libfreebl3.so: cannot open shared object file: No such file or directory Feb 04 09:03:53 localhost.localdomain systemd[1]: sshd.service: main process exited, code=exited, status=127/n/a Feb 04 09:03:53 localhost.localdomain systemd[1]: Failed to start OpenSSH server daemon. -- Subject: Unit sshd.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit sshd.service has failed. -- -- The result is failed. Feb 04 09:03:53 localhost.localdomain systemd[1]: Unit sshd.service entered failed state. Feb 04 09:03:53 localhost.localdomain systemd[1]: sshd.service failed. Feb 04 09:03:53 localhost.localdomain polkitd[821]: Unregistered Authentication Agent for unix-process:22644:1753845907 (system bus name :1.11011, object path /org/freedesktop/PolicyKit1/AuthenticationAge Feb 04 09:03:54 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:54 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:54 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:03:54 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:04:04 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:04:04 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:04:04 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 Feb 04 09:04:04 localhost.localdomain kernel: [drm] EDID has major version 0, instead of 1 [root@localhost mnt]#
The solution is by far is quite clear. In the about output, sshd service is in the state of error. Because it cannot find the libfreebl3.so file. Therefore, try to do something so that it can be discovered by the sshd service. For instance, copy the libfreebl3.so file from another server. Do it but the server must have identical operating system or environment. It is quite simple though but it actually works. So, the main question is why bother copy the needed files ?, why don’t just reinstall the package using yum utility ?. Please remember that the ‘yum’ utility is also broken because of this incident. The following is an attempt to copy the file from another server to the server with the problem :>/p>
1. Copy the file with the name of libfreebl3.so. In this case, the operating system is CentOS. It exists in the /usr/lib64 folder. Execute several commands as follows :
[root@hostname lib64]# pwd /usr/lib64 [root@hostname lib64]# ls -al | grep libfree3.so [root@hostname lib64]# ls -al | grep libfreebl3.so -rwxr-xr-x. 1 root root 11448 May 16 2018 libfreebl3.so [root@hostname lib64]# scp libfreebl3.so root@xxx.xxx.xxx.xxx:/root root@xxx.xxx.xxx.xxx's password: libfreebl3.so 100% 11KB 1.9MB/s 00:00 [root@hostname lib64]#
2. Don’t forget to modify the file permission. Execute the following command :
[root@localhost lib64]# chmod +x libfreebl3.so [root@localhost lib64]#
3. Finally, test the remote access again using ssh command. Before that, don’t forget to restart the sshd service by executing the following command :
[root@localhost lib64]# systemctl restart sshd [root@localhost lib64]#