I recently upgraded to Debian 12 aka Bookworm and have had no major issues so far. However, when I went to SSH into my admittedly much older Debian 8 server I got:
scp -r my_dir_of_files 192.168.1.8:/home/denartha
denartha@192.168.1.8's password:
scp: realpath /home/denartha/my_dir_of_files: No such file
scp: upload "/home/denartha/my_dir_of_files": path canonicalization failed
scp: failed to upload directory my_dir_of_files to /home/denartha
A bit of googling as well as reading the Manpage, revealed the “-O” flag. That manpage entry is:
-O Use the legacy SCP protocol for file transfers instead of the SFTP protocol. Forcing the use of the SCP protocol may be necessary for servers that do not implement SFTP, for backwards-compatibility for particular filename wildcard patterns and for expanding paths with a ‘~’ prefix for older SFTP servers.
Adding the -O flag will use the legacy SCP protocol allowing you to securely copy files onto an older system. My advice is to set up an alias for SCP like this:
alias scp='scp -O'
Then, whenever you run the SCP command, it will automatically include the -O switch.