Bug 1151148
| Summary: | Can't connect to sshd | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Mikhail <mikhail.v.gavrilov> | ||||
| Component: | openssh | Assignee: | Petr Lautrbach <plautrba> | ||||
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 21 | CC: | mattias.ellert, mgrepl, mikhail.v.gavrilov, plautrba, tmraz | ||||
| Target Milestone: | --- | Keywords: | Reopened | ||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2014-10-10 12:46:40 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Mikhail
2014-10-09 16:29:14 UTC
Your sshd host keys are not generated: debug1: could not open key file '/etc/ssh/ssh_host_rsa_key': No such file or directory Could not load host key: /etc/ssh/ssh_host_rsa_key debug1: could not open key file '/etc/ssh/ssh_host_ecdsa_key': No such file or directory Could not load host key: /etc/ssh/ssh_host_ecdsa_key debug1: could not open key file '/etc/ssh/ssh_host_ed25519_key': No such file or directory Could not load host key: /etc/ssh/ssh_host_ed25519_key You can run 'systemctl start sshd-keygen.service' or generate them yourself manually, see 'HostKey' in 'man sshd_config' and 'man ssh-keygen' The question is why the sshd-keygen.service was not started automatically. Was that fresh install? How did you install the system? Reading the description and bug #1151157, I guess Mikhail run his sshd manually using '/usr/sbin/sshd -d' command instead of starting sshd.service. Am I correct Mikhail? (In reply to Tomas Mraz from comment #2) > The question is why the sshd-keygen.service was not started automatically. > Was that fresh install? How did you install the system? Yes, this is fresh install Beta TC1 # sysctl start sshd-keygen.service sysctl: cannot stat /proc/sys/start: No such file or directory sysctl: cannot stat /proc/sys/sshd-keygen/service: No such file or directory (In reply to Petr Lautrbach from comment #3) > Reading the description and bug #1151157, I guess Mikhail run his sshd > manually using '/usr/sbin/sshd -d' command instead of starting sshd.service. > Am I correct Mikhail? Yes, I am rum by hand for get more logs here. (In reply to Mikhail from comment #4) > # sysctl start sshd-keygen.service > sysctl: cannot stat /proc/sys/start: No such file or directory > sysctl: cannot stat /proc/sys/sshd-keygen/service: No such file or directory > It's not sysctl but systemctl # systemctl start sshd-keygen.service If you need debug logs from sshd, change LogLevel in sshd_config, restart sshd.service (systemctl restart sshd.service) and run either: # systemctl status -l sshd.service or # journalctl -l -u sshd.service [root@localhost ~]# systemctl start sshd-keygen.service [root@localhost ~]# systemctl status sshd-keygen.service ● sshd-keygen.service - OpenSSH Server Key Generation Loaded: loaded (/usr/lib/systemd/system/sshd-keygen.service; static) Active: inactive (dead) strange but sshd-keygen.service can't run :( You've missed '-l' option:
# systemctl status -l sshd-keygen.service
● sshd-keygen.service - OpenSSH Server Key Generation
Loaded: loaded (/usr/lib/systemd/system/sshd-keygen.service; static)
Active: inactive (dead)
start condition failed at Fri 2014-10-10 09:38:19 CEST; 3h 59min ago
none of the trigger conditions were met
When I look into sshd-keygen.service I can see the conditions:
# cat /usr/lib/systemd/system/sshd-keygen.service
[Unit]
Description=OpenSSH Server Key Generation
ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key
ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key
ConditionPathExists=|!/etc/ssh/ssh_host_ed25519_key
PartOf=sshd.service sshd.socket
[Service]
ExecStart=/usr/sbin/sshd-keygen
Type=oneshot
RemainAfterExit=yes
All paths exist on my system, so lets remove one of them and try to run sshd-keygen.service again:
# rm /etc/ssh/ssh_host_rsa_key*
rm: remove regular file ‘/etc/ssh/ssh_host_rsa_key’? y
rm: remove regular file ‘/etc/ssh/ssh_host_rsa_key.pub’? y
# systemctl start sshd-keygen.service
# systemctl status -l sshd-keygen.service
● sshd-keygen.service - OpenSSH Server Key Generation
Loaded: loaded (/usr/lib/systemd/system/sshd-keygen.service; static)
Active: active (exited) since Fri 2014-10-10 13:39:36 CEST; 2s ago
Process: 12755 ExecStart=/usr/sbin/sshd-keygen (code=exited, status=0/SUCCESS)
Main PID: 12755 (code=exited, status=0/SUCCESS)
Oct 10 13:39:36 hulk.w.lan sshd-keygen[12755]: Generating SSH2 RSA host key: [ OK ]
It's also possible that you've got bad labels on host key files, you can run:
# restorecon -Rv /etc/ssh
and restart sshd.service
[mikhail@localhost ~]$ ssh root.0.250 ssh: connect to host 10.10.0.250 port 22: Connection refused [mikhail@localhost ~]$ su - Password: [root@localhost ~]# systemctl status -l sshd-keygen.service ● sshd-keygen.service - OpenSSH Server Key Generation Loaded: loaded (/usr/lib/systemd/system/sshd-keygen.service; static) Active: inactive (dead) [root@localhost ~]# systemctl restart sshd-keygen.service [root@localhost ~]# systemctl status -l sshd-keygen.service ● sshd-keygen.service - OpenSSH Server Key Generation Loaded: loaded (/usr/lib/systemd/system/sshd-keygen.service; static) Active: inactive (dead) [root@localhost ~]# rm /etc/ssh/ssh_host_rsa_key* rm: remove regular file ‘/etc/ssh/ssh_host_rsa_key’? y rm: remove regular file ‘/etc/ssh/ssh_host_rsa_key.pub’? y [root@localhost ~]# systemctl restart sshd-keygen.service [root@localhost ~]# systemctl restart sshd.service [root@localhost ~]# ssh root.0.250 root.0.250's password: removing /etc/ssh/ssh_host_rsa_key* helps, but after system reboot I need do it again :( It would need more information, please do following steps: 1. set "LogLevel DEBUG" in /etc/ssh/sshd_config 2. reboot your system and relabel your filesystem: # fixfiles onboot && reboot 3. provide logs since boot: # journalctl -b -l Created attachment 945584 [details]
journalctl -b -l
Is your sshd.service enabled? # systemctl is-enabled sshd.service I guess that no. To enable sshd.service run: # systemctl enable sshd.service I am sorry! Big thanks! |