(Solved: user error) Dietpi automatic setup: OpenSSH login fails ? Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
inspector71
Posts: 15
Joined: Thu Aug 05, 2021 3:56 am

(Solved: user error) Dietpi automatic setup: OpenSSH login fails ?

Post by inspector71 »

UPDATE: user error.



In dietpi.txt:

Code: Select all

##### Software Options #####
# SSH server choice: 0=none/custom | -1=Dropbear | -2=OpenSSH
AUTO_SETUP_SSH_SERVER_INDEX=-2
...

Code: Select all

# Software to automatically install
# - List of available software IDs: https://github.com/MichaIng/DietPi/wiki/DietPi-Software-list
# - Add as many entries as you wish, one each line.
# - DietPi will automatically install all pre-reqs (e.g. ALSA/X11 for desktops etc)
# - E.g. the following (without the leading "#") will install the LXDE desktop automatically on first boot:
# OpenSSH Client
AUTO_SETUP_INSTALL_SOFTWARE_ID=0
...

Code: Select all

# OpenSSH Server
AUTO_SETUP_INSTALL_SOFTWARE_ID=105
However the credentials documented here:

https://dietpi.com/docs/software/ssh/#openssh

... are not working.

Note: I do have this as well:

Code: Select all

# Fail2Ban
AUTO_SETUP_INSTALL_SOFTWARE_ID=73
Is there possibly an issue with the default Fail2Ban config?

Have not knowingly installed a firewall and only attempting to access DietPi via LAN.

Would use authorised_keys but not seeing an option for that, so I guess I need to write a separate script.

Please let me know if I can help.
Last edited by inspector71 on Tue Aug 10, 2021 6:23 am, edited 1 time in total.
User avatar
Joulinar
Posts: 5619
Joined: Sat Nov 16, 2019 12:49 am

Re: Dietpi automatic setup: OpenSSH login fails ?

Post by Joulinar »

Maybe you like to share what image you are running. RPI or some other device? 32bit or 64bit?
Would use authorised_keys but not seeing an option for that, so I guess I need to write a separate script.
There is no option in DietPi so automatically use SSH keys. This would need to be setup manually.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
inspector71
Posts: 15
Joined: Thu Aug 05, 2021 3:56 am

Re: Dietpi automatic setup: OpenSSH login fails ?

Post by inspector71 »

Joulinar wrote: Mon Aug 09, 2021 9:37 am Maybe you like to share what image you are running. RPI or some other device? 32bit or 64bit?
https://dietpi.com/downloads/images/Die ... -Buster.7z

Downloaded on 23rd July 2021.

aarch64

If that is not 7.4.2 out of the box, which I doubt, than DietPi is self-upgrading to 7.4.2 automatically, as is no doubt intended.

Hardware is a DeskPi Pro with an RPi4 including 4GB RAM.

Installation method:

balenaEtcher creates the image on a SanDisk 32GB Ultra USB stick with a USB3 interface and it's plugged into a USB3 port.

Currently booting to a logged in screen as root.

Using PuTTY from a Windows 10 laptop on the same network. Have connected to a previous DietPi instance via OpenSSH using PuTTY.

PuTTY receives a username prompt as I do not have that pre-filled. I type in root and the the Password prompt. I type in what I think is the password and PuTTY just hangs until it times out.

Then, subsequent new PuTTY windows fail to display even a Login (username) prompt.

shutdown -r now

Wow, still no Login prompt, just a quick timeout.

sshd, fail2ban are confirmed to be running via htop.

Set the log system to full. /var/log/fail2ban.log remains empty whilst /var/log/auth.log does contain references to the failed logins.

So I changed the root passwd and it still failed.

Checked /etc/ssh/sshd_config:

Code: Select all

PermitRootLogin yes
All very strange!
User avatar
Joulinar
Posts: 5619
Joined: Sat Nov 16, 2019 12:49 am

Re: Dietpi automatic setup: OpenSSH login fails ?

Post by Joulinar »

I did an automated test installation and for me it's working without issues.

can you check following

Code: Select all

journalctl -u ssh.service
fail2ban-client status sshd
if you did to many failed logins, you most probably got blocked by fail2ban now
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
inspector71
Posts: 15
Joined: Thu Aug 05, 2021 3:56 am

Re: Dietpi automatic setup: OpenSSH login fails ?

Post by inspector71 »

Looks like fail2ban was kicking in as suggested.

Must have chased my tail when trying passwords. There's possibly three that I thought may apply. One from dietpi.txt; the default dietpi password; the password I changed to via console to force a known password.

Apologies for wasting your time. This thread may be possibly best deleted to remove rubbish from people's searches and browsing for real issues.
Last edited by inspector71 on Wed Aug 11, 2021 2:09 am, edited 1 time in total.
User avatar
Joulinar
Posts: 5619
Joined: Sat Nov 16, 2019 12:49 am

Re: (Solved: user error) Dietpi automatic setup: OpenSSH login fails ?

Post by Joulinar »

there is just a single root password. You would need to use the new one as soon as you have changed it via one of the available methods. :)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply