Backup to SSH fails when SSH server prints to STDERR

Bug #1078979 reported by Luke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Back In Time
Fix Released
High
Germar

Bug Description

Attempting to try out the new backup over SSH feature as per https://bugs.launchpad.net/backintime/+bug/1077446/comments/5.

Situation
----------
Password-less login to remote SSH server set up and working correctly. Remote server prints a banner message to STDERR on login (see man sshd_config -> banner).

user@local$ ssh user@remote
Authorized uses only. All activity may be \ <------------- banner printed to STDERR
monitored and reported. <-------------

Last login: Thu Nov 15 12:09:09 2012 from local
[user@remote ~]$ cat /etc/ssh/sshd_config|grep Banner
Banner /etc/issue.net
[user@remote ~]$ cat /etc/issue.net
Authorized uses only. All activity may be \
monitored and reported.

Back In Time reports an error:
"Check commands on host remote returned unknown error:
Authorized uses only. All activity may be \
monitored and reported.

Look at 'man backintime' for further instructions"

Note: remote server can not be modified to remove banner (not under my control)

Workaround
--------------
Suggest you check exit code instead of STDERR before raising mount.MountException in sshtools.py (patch attached)

Could add "-q" to the ssh command instead e.g. line 278
    output, err = subprocess.Popen(['ssh', '-q', '-p', str(self.port) etc...)

Revision history for this message
Luke (tiliqua-au) wrote :
Revision history for this message
Germar (germar) wrote :

Thanks Luke. Your patch looks good. This bug occurs on other places, too. (check_chipher and save permissions in take_snapshot)

Changed in backintime:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Germar (germar)
Revision history for this message
Luke (tiliqua-au) wrote :

Thanks. As an aside, have you considered using paramiko (www.lag.net/paramiko) or pysftp (http://code.google.com/p/pysftp), a higher level abstraction of paramiko, for the ssh functionality? Just a thought, not an enhancement request.

Revision history for this message
Germar (germar) wrote :

I did. But paramiko would have caused lots of changes all over BIT's main code. And with the fact that BIT is not at all portable to other platforms (which would be the biggest advance of paramiko) I decided to not use it and make things lot easier.

Changed in backintime:
status: Confirmed → Fix Committed
Germar (germar)
Changed in backintime:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.