# Strange problem with scp

**URL:** <https://dietpi.com/forum/t/strange-problem-with-scp/22568>\
**Category:** Troubleshooting\
**Created:** [21 January 2025 18:38 UTC](https://dietpi.com/forum/t/strange-problem-with-scp/22568 "2025-01-21T18:38:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jiff](https://dietpi.com/forum/user_avatar/dietpi.com/jiff/32/7438_2.png) [@Jiff](https://dietpi.com/forum/u/Jiff)\
**Post date:** [21 January 2025 18:38 UTC](https://dietpi.com/forum/t/strange-problem-with-scp/22568/1 "2025-01-21T18:38:39Z")

</div>

### 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.

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [22 January 2025 09:24 UTC](https://dietpi.com/forum/t/strange-problem-with-scp/22568/2 "2025-01-22T09:24:10Z")

</div>

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:

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

```

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

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

```

---

<div class="post-metadata">

**Author:** ![Jiff](https://dietpi.com/forum/user_avatar/dietpi.com/jiff/32/7438_2.png) [@Jiff](https://dietpi.com/forum/u/Jiff)\
**Post date:** [22 January 2025 13:02 UTC](https://dietpi.com/forum/t/strange-problem-with-scp/22568/3 "2025-01-22T13:02:29Z")

</div>

Thanks a lot Jappe, as I took my .bashrc from Debian, PS1 is always defined, but SSH\_TTY did the trick.

---

<div class="post-metadata">

**Author:** ![system](https://dietpi.com/forum/uploads/default/original/1X/7e1021de2213860bce185915ce2c1786e56490ec.png) [@system](https://dietpi.com/forum/u/system)\
**Post date:** [22 April 2025 13:02 UTC](https://dietpi.com/forum/t/strange-problem-with-scp/22568/4 "2025-04-22T13:02:53Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
