I've recently set up a fairly minimal Debian server (fail2ban and ufw installed with the OpenSSH profile enabled) with a user with default shell /bin/bash:
$ grep "$(whoami)" /etc/passwd
nightfirecat:x:1000:1000::/home/nightfirecat:/bin/bash
When I run scp file server.ip from my machine, I get the following output:
$ scp file server.ip
lost connection
However, when I change my default shell on the server to /bin/sh via sudo usermod --shell /bin/sh nightfirecat or sudo chsh -s /bin/sh nightfirecat, the scp command succeeds.
$ scp file server.ip
file 100% 16KB 314.8KB/s 00:00
The same behavior is observed when running ssh commands: (using ssh to connect remotely works fine with either shell)
$ ssh server.ip 'echo foo' # /bin/bash shell
$ ssh server.ip 'echo foo' # /bin/sh shell
foo
My /var/log/auth.log logs don't seem to indicate any authentication issue, and debug logs from scp don't illuminate the problem. I do have a .bashrc file that runs on login, however its first commands are [ -z "$PS1" ] && exit to exit on non-interactive logins.