Strange problem with scp

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version | cat /boot/dietpi/.version
    G_DIETPI_VERSION_CORE=9
    G_DIETPI_VERSION_SUB=9
    G_DIETPI_VERSION_RC=0
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
    G_LIVE_PATCH_STATUS[0]=‘applied’
    G_LIVE_PATCH_STATUS[1]=‘applied’
    G_LIVE_PATCH_STATUS[2]=‘not applicable’
    G_LIVE_PATCH_STATUS[3]=‘not applicable’

  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
    bookworm

  • Kernel version | uname --all
    Linux t62.FQDN 6.1.84-vendor-rk35xx #1 SMP Tue Dec 24 13:36:04 UTC 2024 aarch64 GNU/Linux

  • Architecture | dpkg --print-architecture
    arm64

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
    NanoPi 6 series (aarch64)

  • Power supply used | (EG: 5V 1A RAVpower)
    Mean Well LRS-50-12 (50W/12V)

  • SD card used | (EG: SanDisk ultra)
    System is running from the eMMC

Additional Information (if applicable)

  • Software title | (EG: Nextcloud)
    scp

  • Was the software title installed freshly or updated/migrated?
    Freshly

  • Can this issue be replicated on a fresh installation of DietPi?
    Duno

← If you sent a “dietpi-bugreport”, please paste the ID here →

  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

Add this line :
neofetch
at the end of $HOME/.bashrc

Expected behaviour

As this line do not break anything in Debian, I expect DietPi to act the same way.

Actual behaviour

ssh works normally, but opposite to all other machines, scp is failing, saying it received a too long string - insisting on tab shows a lot of backslashes.

Extra details

I commented my line and everything came back to normal.

This is weird as it looks like a very old bug in the ssh server.

Another (funny) thing is DietPi is reversing all devices order (mmcblk 0 and 1, eth 0 and 1) but it is not a bug, just a bit strange.

When you include neofetch in .bashrc, it outputs system information every time a new shell session is initiated, even in non-interactive sessions (like SCP).
So you can add a condition to only execute if in non-interactive sessions:

if [ -n "$PS1" ]; then
    neofetch
fi

or test if SSH_TTY is set, it’s also only set in ssh sessions but not scp

if [ -n "$SSH_TTY" ]; then /usr/bin/neofetch; fi