Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
how does your bashrc involved in this? scp doesn't spawn a bash shell, so that wouldn't get executed. just enable a banner in /etc/ssh/sshd_config and off you go.
I don't know the scp internals, but .bashrc is invoked upon scp connections. If I put an echo in .bashrc, it will be executed and the scp command fails. If I put an echo in .profile (or .bash_profile) it will not be executed upon scp, but still remains for ssh connections (since they start a login shell). So you have two alternatives:
1) put the banner in /etc/profile
2) enable the Banner option in sshd_config as suggested by acid_kewpie above
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.