Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh.chat: Deploy Tor hidden service endpoint #375

Open
nya-furball opened this issue Mar 7, 2021 · 12 comments
Open

ssh.chat: Deploy Tor hidden service endpoint #375

nya-furball opened this issue Mar 7, 2021 · 12 comments
Labels

Comments

@nya-furball
Copy link

Is there any interest in offering ssh.chat as both a clearnet server and hidden service? If there is, I am willing to help out with setting up stuff!

@shazow
Copy link
Owner

shazow commented Mar 7, 2021

Not a bad idea, I'm happy to host it on the same instance. Do you have a fav guide?

Biggest downside is latency is probably gonna be gross.

@nya-furball
Copy link
Author

nya-furball commented Mar 7, 2021

If you don't need advanced features like vanguard, it's relatively easy. Just skip step 1 of this guide: https://community.torproject.org/onion-services/setup/
IGNORE BELOW! TYPO!
When you are in step 2, change the line "HiddenServicePort 80 127.0.0.1:80" to " HiddenServicePort 2 127.0.0.1:22" and change the name of your directory on the line "HiddenServiceDir /var/lib/tor/my_website/"

@nya-furball
Copy link
Author

You should be able to start the onion service without shutting down the ssh-chat service. This should preserve chat logs and uptime.

@shazow shazow changed the title Adding Tor functionality to ssh.chat? ssh.chat: Deploy Tor hidden service endpoint Mar 7, 2021
@shazow shazow added the Soon label Mar 7, 2021
@shazow
Copy link
Owner

shazow commented Mar 7, 2021

Awesome, I'll add it to the TODO list.

Also IIRC there's a Go-native implementation of onion services somewhere, wonder if I could embed it as a native feature of ssh-chat easily, will look into it briefly.

@nya-furball
Copy link
Author

IMHO: Not worth it. Adding additional code can compromise software security. Tor is easy to interface with existing services, so might as well use that.

@shazow
Copy link
Owner

shazow commented Mar 7, 2021

It's more of a balancing act of how much maintenance things require for me, fewer moving pieces (ie. keeping one binary up) is always easier than a rube goldberg machine of systemd services. But yes, I'll keep that in mind.

@nya-furball
Copy link
Author

True. However, when you use the official package provided by the Tor Project, you get the backing of an organization that maintains the software, fixes vulns and does research on the latest threats to the tor network. Feel free to do however you like though, as I don't know how your infrastructure is deployed.

@nya-furball
Copy link
Author

shazow: I made a typo in my recommendation! Strike out the modified lines! Having two services listen on the same port will mess up your server!

@shazow
Copy link
Owner

shazow commented Apr 5, 2021

@nya-furball Welcome back!

@nya-furball
Copy link
Author

UwU

@camosoul
Copy link

camosoul commented Mar 25, 2022

It's very easy to do...

ssh-chat --bind=:[port]
skip the ip so it listens to all

Add lines to /etc/tor/torrc

HiddenServiceDir /var/lib/tor/ssh-chat/
HiddenServicePort [port] 127.0.0.1:[port]

Then restart tor daemon and cat /var/lib/tor/ssh-chat/hostname

If you want to make it tor-only, make the --bind=127.0.0.1:[port]

...don't use port 22. That's for real ssh sessions. Plus, you can't reverse ssh tunnel below port 1001 without root... Pick a number above so you don't have to expose root.

...make sure client has torsocks installed.

If you use the same ssh key, you just gave away your identity, so...

@shazow
Copy link
Owner

shazow commented Mar 25, 2022

@camosoul That's helpful, thanks. :) Just need to get around to it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants