Linux - General This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-15-2009, 03:31 PM
|
#1
|
|
Member
Registered: Jun 2006
Location: CA
Distribution: Ubuntu, CentOS, Scientific Linux
Posts: 97
Rep:
|
banners and scp
Part of some security requirements I have to implement on the computers I SA for is to have a banner display a message upon login.
The problem is that this banner will break scp connections. Is there a workaround for this?
|
|
|
|
05-15-2009, 03:42 PM
|
#2
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,707
|
Why will it break it? If it did then it wouldn't be possible to show it, would it? Works fine for me, maybe you could clarify what you mean?
|
|
|
|
05-15-2009, 03:46 PM
|
#3
|
|
Member
Registered: Jun 2006
Location: CA
Distribution: Ubuntu, CentOS, Scientific Linux
Posts: 97
Original Poster
Rep:
|
I remember having this issue whenever my .bashrc printed something to the screen. Whenever I would try to perform an scp I would get the following:
protocol error: unexpected <newline>
If a banner is printed to the screen after a successful login, won't it break scp with this "unexpected <newline>"?
|
|
|
|
05-15-2009, 03:50 PM
|
#4
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,707
|
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.
|
|
|
|
05-15-2009, 04:08 PM
|
#5
|
|
Moderator
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.4 OpenSuSE 12.2
Posts: 9,897
|
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
|
|
|
|
05-15-2009, 04:23 PM
|
#6
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,707
|
i tried an scp with an echo in my .bashrc and it did nothing, on Ubuntu 8.10. Odd.
|
|
|
|
05-15-2009, 04:38 PM
|
#7
|
|
Member
Registered: Jun 2006
Location: CA
Distribution: Ubuntu, CentOS, Scientific Linux
Posts: 97
Original Poster
Rep:
|
Thanks, I got the banner working without breaking scp using the sshd_config setting.
acid_kewpie, did you have a newline in the text you echoed?
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:30 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|