- Add these lines to
/etc/tor/torrc
HiddenServiceDir /var/lib/tor/ssh_hidden_service/
HiddenServicePort 22 127.0.0.1:22
HiddenServiceAuthorizeClient stealth client_name
- Restart tor service
- Get onion address and client key from
/var/lib/tor/ssh_hidden_service/hostname
Example:
fxpnxrbqvto6dypc.onion fd1s5f65d1f6s8r1vr651v # client: client_name
- Add hidden service secret to
/etc/tor/torrc
Example:
HidServAuth fxpnxrbqvto6dypc.onion fd1s5f65d1f6s8r1vr651v
- Restart tor service
- Add these lines to
~/.ssh/config
Host *.onion
ProxyCommand nc -x 127.0.0.1:9050 -X5 %h %p
You should now be able to ssh using your server's onion domain.
Example:
ssh [email protected]