Bug 1008589
Summary: | qemu+ssh fails if bashrc contains banners | ||
---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | Jonathan Lebon <jlebon> |
Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> |
Status: | CLOSED WONTFIX | QA Contact: | |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | unspecified | CC: | acathrow, eblake, pmoore |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-09-16 16:30:13 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jonathan Lebon
2013-09-16 16:17:38 UTC
In general, ALL ssh operations are liable to fail if you have a banner. The bug is on your end for having a noisy remote shell login, and libvirt can't be taught how to work around every whim of every person's banner. Instead, you should follow the usual conventions of fixing your .bashrc to output a banner ONLY for an interactive login, and to be silent for the case of remote command execution that does not require an interactive shell. (In reply to Jonathan Lebon from comment #0) > Description of problem: > > If a user's bashrc contains print statements, libvirt cannot cope with it > (it tries to interpret them as libvirtd messages maybe?). When libvirt connects over SSH, the stdin + stdout of the SSH connection are used to transport the RPC protocol. Anything else printed to stdout will of course corrupt the protocol. > Steps to Reproduce: > 1. add 'echo this is text' to user ~/.bashrc file Really do not do this. If you want to a banner displayed to people at login time, the /etc/motd file can be used. This correctly displays the message on interactive shells, without corrupting data on non-interactive sessions as used by libvirt. $ cat /etc/motd I am the motd $ ssh localhost Last login: Mon Sep 16 17:26:51 2013 from localhost I am the motd # logout Connection to localhost closed. $ ssh localhost /bin/date Mon 16 Sep 17:30:45 BST 2013 You don't necessarily have to use /etc/motd (since that gives the same banners to all users); for any per-user stuff, just be sure to use the same principles as what system profile does for /etc/motd. when writing your .bashrc: # Limit banner to interactive logins case $- in *i*) your noisy banner here ;; esac |