Hacker News new | ask | show | jobs
by logicallee 4 days ago
Thank you! I tried it and it works well. Very useful and easy to use, since it's just one line

    croc send [file(s)-or-folder]
screenshot:

https://imgur.com/a/tqibr0D

also works on folders (directories). It's a good project, I donated to its author.

1 comments

croc is my number one favorite under-used under-rated projects.

Literally any two devices on just about any internet connected device, supposing only that you're not on a super locked down corporate network can share files and now even ssh sessions so you can croc in to an existing ssh session if you want to have a single ssh session shared across multiple devices.

Love that you donated!

thanks for sharing. what do you mean by croc in to an existing ssh session, could you explain a bit more?
>croc ssh

generates one persistent shell with two seperate six sword croc secrets, one for someone with read/write, and one for someone with read-only. You can then croc $secret_words in a seperate terminal (on another internet connected machine if you want), and IO in the original terminal will be mirrored to the observing terminal.

If the mirroring terminal has read/write, commands typed there are executed in the 'host' terminal.

If the mirroring terminal only has read, you can use it to monitor a long running job, server logs, or to share with someone for support like RDP/share my screen, or I suppose to give a presentation on a machine that doesn't have all of your tooling from a laptop with croc...if you're in a weird combination of instances in which you have both a group to show your terminal to and don't have direct access to your terminal.

You can do all of this without configuring ssh on the public/other machine, so if, for instance, you had an ssh session on one machine, and needed to access that ssh session from a machine where you don't have (and perhaps don't want) your ssh key to sit, you can croc from the public machine to your private running ssh.

I typically use it for when I just want a quick "hey can you check what I'm doing here" because I don't have to set up/manage ssh keys as the croc keys only live as long as I want them to. Or the reverse, "this is what you're going to type and what you should see" without creating a recording/screenshare.

I also have a dynamic IP at home and don't really care to set up tailscale and/or vpn to my home machine so if I feel I might need access to my machine i can run croc before leaving and connect from just about anywhere.

And it still all works either cli/web.

Check it out: https://getcroc.com/blog/share-terminal-with-croc-ssh

edit: oh! and you can >croc relay on say a server and then you can use your own routing instead of the public croc relay for the web clients