Wednesday, 28 November 2007

providing ssh as a tor-hidden-service

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

step 1: create the service

create the service-directory

mkdir /var/lib/tor/hidden_service
mkdir /var/lib/tor/hidden_service/ssh
chown tor /var/lib/tor/hidden_service/ssh (may be "debian-tor" for debian-users)


now add to your /etc/tor/torrc

HiddenServiceDir /var/lib/tor/hidden_service/ssh
HiddenServicePort 22 127.0.0.1:22


step 1a: reload tor and check that it works

/etc/init.d/tor reload
tail /var/log/tor/log

now

cat /var/lib/tor/hidden_service/ssh/hostname

will give you the .onion-address to use

step 2: configure the client

first, download connect.c from latency.net to allo ssh to connect to a socks-proxy.
compile it with

gcc connect.c -o /etc/ssh/connect

and in /etc/ssh/ssh_config
add the following configuration for all .onion-addresses


# use /etc/ssh/connect to use tor to connect to ssh in torland
Host *.onion
ProxyCommand /etc/ssh/connect -S localhost:9050 %h %p



done. Now you can do a "ssh fox@XYZ.onion" every time your local tor-server is running.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: http://firegpg.tuxfamily.org

iD8DBQFHZ6d7LAZ+Vq4hPgARAiDUAJ4zj99ZM8vwwNnEhi6UeR9WbUNTEACgtSgb
Br17oxsyxfwoTwLxL+rr2zg=
=rQE0
-----END PGP SIGNATURE-----

No comments: