You are not logged in.
SSH wont start after install:
# /usr/bin/sshd
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.
I thought the installation would take care of key-generation as nothing is mentioned on the install section of the wiki SSHD.
Should the install section on the wiki contain a bunch of:
ssh-keygen <options>
In that case, what would be best practice options for default keys?
Something else that might be wrong with my system?
What I've tried so far:
# pacman -Rsn openssh
# rm -fr /etc/ssh
# pacman -S openssh
Last edited by JKAbrams (2013-06-18 14:11:27)
Offline
You should start it via the systemd service because that will generate the keys
This will run /usr/bin/ssh-keygen -A
Offline
You should start it via the systemd service because that will generate the keys
This will run /usr/bin/ssh-keygen -A
It does not seem to:
# systemctl start sshd
# systemctl status sshd
sshd.service - OpenSSH Daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled)
Active: failed (Result: start-limit) since ons 2013-06-19 08:49:49 NZST; 3s ago
Process: 1705 ExecStart=/usr/bin/sshd -D (code=exited, status=1/FAILURE)
jun 19 08:49:49 mba systemd[1]: Starting OpenSSH Daemon...
jun 19 08:49:49 mba systemd[1]: Started OpenSSH Daemon.
jun 19 08:49:49 mba systemd[1]: sshd.service: main process exited, code=exited, status=1/FAILURE
jun 19 08:49:49 mba systemd[1]: Unit sshd.service entered failed state.
jun 19 08:49:49 mba systemd[1]: sshd.service holdoff time over, scheduling restart.
jun 19 08:49:49 mba systemd[1]: Stopping OpenSSH Daemon...
jun 19 08:49:49 mba systemd[1]: Starting OpenSSH Daemon...
jun 19 08:49:49 mba systemd[1]: sshd.service start request repeated too quickly, refusing to start.
jun 19 08:49:49 mba systemd[1]: Failed to start OpenSSH Daemon.
jun 19 08:49:49 mba systemd[1]: Unit sshd.service entered failed state.
# /usr/bin/sshd
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.
But after running ssh-keygen -A manually, it works.
/usr/bin/ssh-keygen -A
ssh-keygen: generating new host keys: RSA1 RSA DSA ECDSA
# systemctl start sshd
# systemctl status sshd
sshd.service - OpenSSH Daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled)
Active: active (running) since ons 2013-06-19 08:53:28 NZST; 2s ago
Main PID: 1715 (sshd)
CGroup: name=systemd:/system/sshd.service
└─1715 /usr/bin/sshd -D
jun 19 08:53:28 mba systemd[1]: Started OpenSSH Daemon.
jun 19 08:53:28 mba sshd[1715]: Server listening on 0.0.0.0 port 22.
jun 19 08:53:28 mba sshd[1715]: Server listening on :: port 22.
Offline
Hmm not sure why it didn't work when running the service. But if it is working now please mark the thread as solved
Offline
Hmm not sure why it didn't work when running the service. But if it is working now please mark the thread as solved
Yeah, it works for me now, thanks for your help, didn't know about the -A flag.
But I'm looking to fix the underlying problem here, if it indeed is a problem for more users and not just for me, I don't want to report a bug if I've just done something stupid...
Is is repeatable.
Offline
I just removed the ssh_host* files from my system and then ran systemctl start sshd.service and it created the ssh_host_* files for me...So not sure why it didnt work for you...
Offline
Ok, so I found out what causes this, turns out I DID do something stupid.
For some reason sshdgenkeys.service was already started before I tried to start sshd.service, this makes sshd.service fail and no keys are generated, so the solution is to make sure sshdgenkeys.service is stopped before trying to start sshd.service.
Marking this as SOLVED now.
Offline