You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

SCP Command Unable to Transfer Files Only For Specific User

edited Jan 8, 2024 11:09PM in Linux

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.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!