Can't ssh / login into shell

Hi!

Sorry for not being able to post DietPi’s system info, but I cannot login to DietPi anymore and hence not retrieve the info any longer.

I use WinSCP latest version and one day all of a sudden it stopped working when trying to log in. My DietPI system is a RPi 3 aamd64 v7 runnning Bullseye v11 as far as I know.

I use latest stable DietPi (v8.16 I assume). And the whole system works normally, sends emails, installed packages run fine (e.g. Pihole, Bitwarden, etc.) - I just cannot WinSCP into it. :frowning:

Here is WinSCP’s log of the login process:

. 2023-05-04 19:12:44.348 --------------------------------------------------------------------------
. 2023-05-04 19:12:44.348 WinSCP Version 5.21.8 (Build 13000 2023-04-11) (OS 10.0.19044 - Windows 10 Enterprise)
. 2023-05-04 19:12:44.348 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2023-05-04 19:12:44.348 Log level: Debug 1, Logging passwords
. 2023-05-04 19:12:44.349 Local account: XXX
. 2023-05-04 19:12:44.349 Working directory: C:\Program Files (x86)\WinSCP
. 2023-05-04 19:12:44.349 Process ID: 8492
. 2023-05-04 19:12:44.361 Ancestor processes: explorer, ...
. 2023-05-04 19:12:44.361 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" 
. 2023-05-04 19:12:44.362 Time zone: Current: GMT+2, Standard: GMT+1 (Mitteleuropäische Zeit), DST: GMT+2 (Mitteleuropäische Sommerzeit), DST Start: 26.03.2023, DST End: 29.10.2023
. 2023-05-04 19:12:44.362 Login time: Donnerstag, 4. Mai 2023 19:12:44
. 2023-05-04 19:12:44.363 --------------------------------------------------------------------------
. 2023-05-04 19:12:44.363 Session name: raspberry Pi 3 (Bullseye v11) (Site)
. 2023-05-04 19:12:44.363 Host name: 192.168.66.53 (Port: 22)
. 2023-05-04 19:12:44.363 User name: root (Password: XXX, Key file: No, Passphrase: No)
. 2023-05-04 19:12:44.363 Tunnel: No
. 2023-05-04 19:12:44.363 Transfer Protocol: SFTP
. 2023-05-04 19:12:44.363 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2023-05-04 19:12:44.363 Disable Nagle: No
. 2023-05-04 19:12:44.363 Proxy: None
. 2023-05-04 19:12:44.363 Send buffer: 262144
. 2023-05-04 19:12:44.363 Compression: Yes
. 2023-05-04 19:12:44.363 Bypass authentication: No
. 2023-05-04 19:12:44.363 Try agent: Yes; Agent forwarding: No; KI: Yes; GSSAPI: Yes
. 2023-05-04 19:12:44.363 GSSAPI: KEX: No; Forwarding: No; Libs: gssapi32,sspi,custom; Custom: 
. 2023-05-04 19:12:44.363 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2023-05-04 19:12:44.363 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2023-05-04 19:12:44.363 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2023-05-04 19:12:44.363 Simple channel: Yes
. 2023-05-04 19:12:44.363 Return code variable: Autodetect; Lookup user groups: Auto
. 2023-05-04 19:12:44.363 Shell: default
. 2023-05-04 19:12:44.363 EOL: LF, UTF: Auto
. 2023-05-04 19:12:44.363 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2023-05-04 19:12:44.363 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No; Exit code 1 is error: No
. 2023-05-04 19:12:44.363 SFTP Bugs: Auto,Auto
. 2023-05-04 19:12:44.363 SFTP Server: default
. 2023-05-04 19:12:44.363 Local directory: XXX, Remote directory: /usr/bin, Update: Yes, Cache: Yes
. 2023-05-04 19:12:44.364 Cache directory changes: Yes, Permanent: Yes
. 2023-05-04 19:12:44.364 Recycle bin: Delete to: No, Overwritten to: No, Bin path: 
. 2023-05-04 19:12:44.364 DST mode: Unix
. 2023-05-04 19:12:44.364 --------------------------------------------------------------------------
. 2023-05-04 19:12:44.418 Looking up host "192.168.66.53" for SSH connection
. 2023-05-04 19:12:44.419 Connecting to 192.168.66.53 port 22
. 2023-05-04 19:12:44.423 Connected to 192.168.66.53
. 2023-05-04 19:12:44.464 Waiting for the server to continue with the initialization
. 2023-05-04 19:12:44.464 We claim version: SSH-2.0-WinSCP_release_5.21.8
. 2023-05-04 19:12:44.464 Detected network event
. 2023-05-04 19:12:44.464 Connected to 192.168.66.53
. 2023-05-04 19:12:44.512 Detected network event
. 2023-05-04 19:12:44.512 Waiting for the server to continue with the initialization
. 2023-05-04 19:12:44.512 Remote version: SSH-2.0-OpenSSH_8.4p1 Debian-5+deb11u1
. 2023-05-04 19:12:44.512 Using SSH protocol version 2
. 2023-05-04 19:12:44.517 Have a known host key of type ssh-ed25519
. 2023-05-04 19:12:44.517 Have a known host key of type ecdsa-sha2-nistp256
. 2023-05-04 19:12:44.517 Have a known host key of type ecdsa-sha2-nistp521
. 2023-05-04 19:12:44.520 Detected network event
. 2023-05-04 19:12:44.520 Waiting for the server to continue with the initialization
. 2023-05-04 19:12:44.522 Doing ECDH key exchange with curve Curve25519 and hash SHA-256
. 2023-05-04 19:12:44.587 Detected network event
. 2023-05-04 19:12:44.587 Waiting for the server to continue with the initialization
. 2023-05-04 19:12:44.676 Server also has rsa-sha2-512/rsa-sha2-256/ssh-rsa host keys, but we don't know any of them
. 2023-05-04 19:12:44.677 Host key fingerprint is:
. 2023-05-04 19:12:44.677 ssh-ed25519 255 SHA256:XXX
. 2023-05-04 19:12:44.677 Verifying host key ssh-ed25519 0x3bbXXX 7b3bdXXX b23fXXX ccbfXXX ,0x5XXX ab00XXX dc0bXXX 6121XXX  with fingerprints ssh-ed25519 255 SHA256:XXX ssh-ed25519 255 11:ce:16:XXX
. 2023-05-04 19:12:44.728 Host key matches cached key
. 2023-05-04 19:12:44.728 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] outbound encryption
. 2023-05-04 19:12:44.728 Initialised HMAC-SHA-256 outbound MAC algorithm
. 2023-05-04 19:12:44.728 Will enable zlib (RFC1950) compression after user authentication
. 2023-05-04 19:12:44.728 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] inbound encryption
. 2023-05-04 19:12:44.728 Initialised HMAC-SHA-256 inbound MAC algorithm
. 2023-05-04 19:12:44.728 Will enable zlib (RFC1950) decompression after user authentication
. 2023-05-04 19:12:44.731 Detected network event
. 2023-05-04 19:12:44.731 Waiting for the server to continue with the initialization
. 2023-05-04 19:12:44.736 Pageant is running. Requesting keys.

Here is a screenshot of WinSCP… it just waits for ever for “authentification”:

Regards

can you try to connect directly from the shell using ssh root@ip-adress to find out if its an issue of winscp?

What ssh server is installed on dietpi? Dropbear or openssh?

I guess he is using SSH keys and they are not working anymore.

Thank you a lot!

That worked indeed. So it’s not related to DietPi. Sorry, am just sorting out what it could be.

Hi Joulinar!

Hhm, I see. And how can I get rid of that SSH keys? I’ll see if I can find it out …

usually within WinSCP you could specify if using keys or not. As well you could check if the host key is not accepted. Probably needs to be refreshed. Just check in WinSCP.

I got it working again. No clue what exactly I did, but it was related to WinSCP and not DietPi.