gnu-screenttyptybyobu

How to bypass screen/byobu conflicts with zssh file transfers (rz/sz)


I've been trying out zssh's sz and rz because it seems like a quick/easy way to send files back and forth (local <-> remote) over ssh. The problem is that I use byobu (basically screen) on my remote server and this somehow conflicts with the sending and receiving of files.

http://zssh.sourceforge.net/FAQ

Number 6 states that:

Beware that any program interferring (ie non transparent) with the tty/pty
chain will likely prevent file tranfers from working.

For example, running 'screen' on the REMOTE side will prevent zssh from
working properly because it will be messing things between rz and sz.

This is a total bummer because running byobu is an essential part of my remote management toolkit and I haven't found any tool that seems as effortless as zssh.

Can anyone think of a way to get zssh working without having to disable byobu/screen? I would troubleshoot it myself, but this sort of stuff is way over my head (as in, I have no clue why screen would even conflict with a file transmission process like this, so an explanation would be extremely helpful).

Also, any alternative solutions to this problem would be appreciated.

Edit: Wondering if there's a way to quickly drop out of byobu, perform zssh tasks then jump back into the previous byobu session...


Solution

  • Boom. Got it:

    On local, zssh me@remote.com -p <your port>

    On remote byobu you'll want to Shift + F6 to detach your session for a moment (don't worry, we'll get it back after this transfer).

    Now that we're in a plain old shell on the remote server, let's send a file from your local machine to the remote machine. On the remote, type: rz to get ready to receive in this directory (pwd).

    Now, hit Ctrl + Space to bring up the zssh prompt (this prompt is essentially using your local machine's terminal now). Find the file you want (e.g. BillLumberg.gif) and type:

    sz BillLumberg.gif

    The file will automagically send itself to the remote machine and bring you back to the remote prompt.

    Now that the file is uploaded, let's jump back to your previous byobu session.

    byobu -list will show you all of the existing byobu sessions:

    There is a screen on:
        8515.byobu  (10/21/2012 12:36:23 PM)    (Detached)
    

    to restore the specific session, type: byobu -r 8515 and voila. All you actually have to do is byobu -R to restore the previously used session.

    TLDR:

    1. zssh me@remote.com -p <port>
    2. Shift + F6 to detach current byobu
    3. rz to enter receive mode (step only necessary for remote -> local)
    4. Ctrl + Space to local zssh prompt
    5. sz <filename> to send file
    6. byobu -R to restore previous session

    just swap steps 3 and 5 to send a file from remote to local!