SCP Command Unable to Transfer Files Only For Specific User
Applies to:
Oracle Cloud Infrastructure - Version N/A and later
Linux x86-64 – Oracle Linux
Symptoms
When using SCP to copy files to a destination instance for a specific user, the destination host's SSH banner shows correctly but the file
transfer does not occur.
An SSH connection for the same user and destination works correctly.
Cause
In this case, the issue was caused by the presence of a source command in the destination user’s .bashrc file
$ cat /home/<username>/.bashrc
...
source /path/to/script .sh
...
This is a well-known behavior. Sourcing files inside .bashrc can break scp or other non-interactive ssh sessions, depending on the output of the sourced files/scripts.
Tagged:
0