diff --git a/opsec/anonymousremoteserver/index.html b/opsec/anonymousremoteserver/index.html index b55935a..6bc4a05 100644 --- a/opsec/anonymousremoteserver/index.html +++ b/opsec/anonymousremoteserver/index.html @@ -152,23 +152,80 @@ ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHqt0O2ZbRt/7ikk0PdPRcb1GRBE5YNDdBHFCMGIdeHb
To access the server anonymously, you just need to ssh there through tor using torsocks:
+ +To access the server anonymously, you need to configure SSH to use tor and only your chosen key (modify your ~/.ssh/config so it looks like this:
+
+AutomapHostsSuffixes .onion,.exit
+DataDirectory /var/lib/tor
+ExitPolicy reject *:*
+PublishServerDescriptor 0
+SOCKSPort 127.0.0.1:9050 IsolateDestAddr
+HiddenServiceDir /var/lib/tor/onion/tor-ssh
+HiddenServicePort 22
+
+
+ sudo cat /var/lib/tor/onion/tor-ssh/hostname
+
+
+
+Next we are going to setup and harden our client ~/.ssh/config so even if we make a mistake and try reaching our server without tor being connected we won't leak anything:
+
+Host test-server
+ HostName hostnamefromprevi0us5t3p.onion
+ ProxyCommand socat - SOCKS4A:localhost:%h:%p,socksport=9050 # tells ssh to proxy the connection through tor
+ IdentityFile ~/.ssh/ssh-key-test
+ IdentitiesOnly yes # only use the identityFile we configured and don't try any other
+
+
+
+
[ mainpc ] [ /dev/pts/6 ] [~]
-→ cat .ssh/config| head -n4
+→ cat .ssh/config| head -n5
Host test-server
- User root
- hostname 185.216.68.156
- IdentityFile ~/.ssh/id_ed25519
+ HostName hostnamefromprevi0us5t3p.onion
+ ProxyCommand socat - SOCKS4A:localhost:%h:%p,socksport=9050 # tells ssh to proxy the connection through tor
+ IdentityFile ~/.ssh/ssh-key-test
+ IdentitiesOnly yes # only use the identityFile we configured and don't try any other
[ mainpc ] [ /dev/pts/6 ] [~]
-→ torsocks ssh test-server
-The authenticity of host '185.216.68.156 (185.216.68.156)' can't be established.
+→ ssh root@test-server
+The authenticity of host 'hostnamefromprevi0us5t3p.onion' can't be established.
ED25519 key fingerprint is SHA256:Od5FT4wcALDHXXK2B4t6lM8idsDmUfhqWpDFjStgBwI.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
-Warning: Permanently added '185.216.68.156' (ED25519) to the list of known hosts.
+Warning: Permanently added 'hostnamefromprevi0us5t3p.onion'(ED25519) to the list of known hosts.
Linux cockbox 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64
The programs included with the Debian GNU/Linux system are free software;