Send files through remote tmate session?

2,647 views
Skip to first unread message

jav...@carnero.net

unread,
Jan 12, 2016, 12:22:52 PM1/12/16
to tmate.io
Hi, I love tmate since I discovered it a few weeks ago.

I have successfully connected with a remote server using tmate. Now I want to send to the remote server a file, but I don't know how to do it, or even if it is possible.

Previously I have used scp through a reverse ssh tunnel, and now with tmate I would like to do something similar. It is possible? If it is, how?

Thank you.

Nicolas Viennot

unread,
Jan 12, 2016, 2:42:13 PM1/12/16
to jav...@carnero.net, tmate.io
Hey Javier,

So I see two things:

1) Sending files. Maybe the UI could be:

> tmate file_upload some_file
> stdin | tmate file_upload -

And the files would show up in the web interface easily downloadable.

2) Setting up remote tunnels.

I'll have to think about this a little more. Not sure how to expose the ports on the tmate.io servers without having a security problem.

Nico.



--
You received this message because you are subscribed to the Google Groups "tmate.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmate-io+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jav...@carnero.net

unread,
Jan 25, 2016, 6:18:54 AM1/25/16
to tmate.io
Hi Nico, thanks for answering.

I've been thinking about it and I'd like to share with you my thoughts :-) How about making the tmate server (tmate-slave code) compatible with the SCP protocol?

In that way we could send files easily like this:
scp ./test_file mNp4riUdW1xw02rZbzSpxknPl@am2.tmate.io:/home/user/



I don't know if it would be easy or difficult to develop, and I don't have experience with the tmux/tmate code, but I'm willing to give you a hand or even to develop and test on my own if you see that this approach makes sense and it is feasible.

Thanks for everything!

Nicolas Viennot

unread,
Jan 25, 2016, 12:28:34 PM1/25/16
to jav...@carnero.net, tmate.io
Hey Javier :)

This is doable. Here's an API that could work:

1) The upload part. For example:
$ tmate-slave upload some_file
this would upload a file through a new ssh channel (why not using the scp protocol)
The file would be stored somewhere on the tmate-slave server resides.

2) the download part
$ ssh sessio...@tmate-slave.host list-files
$ ssh sessio...@tmate-slave.host cat file
$ scp sessio...@tmate-slave.host:file destination

notes:
- this means that we need a per session chroot environement, deleted when the session terminates
- ENOSPC should be handled gracefully
- eventually we'll want to pass the files to the elixir proxy, and store the files in some database (e.g. s3)

you're welcome to take a stab at it!
however, this is some quite complex piece of code to get working.
If you'd like we can pair on this so it's easier for you to get started?

Nico


--
Reply all
Reply to author
Forward
0 new messages