I've freshly setup a rather standard current Arch Linux and encounter a problem that I can not get a grip on:

  1. DHCP service is enabled and network is online (ping succeeds with hostname and IP address)
  2. OpenSSH service is enabled
  3. OpenSSH config allows public key and password

But I can not connect via SSH unless I also log in locally. Once I logged in locally once, I can logout in and out via SSH without problems, even when the local session is exited.

Journal says that SSH server starts up well before the local login.

Edit: Error message from Putty is "Connection refused"

  • Please expand on what you mean by "can not connect". Does it refuse the TCP connection? Does it accept the connection but deny your key and/or password? Adding to your question the output of ssh -vvv user@host and the contents of the SSH daemon's log when attempting a connection would be helpful. – DopeGhoti Nov 8 '18 at 22:16
  • 1
    Is your home directory encrypted? If it is, the system can't see your home dir until you login, thereby un-encrypting the home dir. – MERM Dec 2 '18 at 20:00
  • @MERM are you aware of any workaround for this problem? – user1330734 Feb 15 at 7:23
  • @MERM thanks for mentioning this possibility, it applied to my case and was solved with instructions at: help.ubuntu.com/community/SSH/OpenSSH/Keys – user1330734 Feb 15 at 7:39

You need to install and enable haveged to generate sufficient entropy for the cryptographic exchange of keys. Possibly related to this bug report.

  • You may want to add how to check the entropy on the system... cat /proc/sys/kernel/random/entropy_avail and list an OK value (>1000) for comparison... – RubberStamp Nov 8 '18 at 22:55
  • installing havegd and enabling the service solved the issue! – Arne Nov 9 '18 at 19:53
  • @Arne you should check if it is still needed with 4.19 when you update to that series. – jasonwryan Nov 9 '18 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.