r/ComputerSecurity • u/watchoutitstaco • Apr 27 '22
Connecting to my computer remotely and securely
Hi everyone,
I have wanted to be able to connect to my desktop remotely for a long time. I want to be able to be wherever (AKA I don't know what my IP will be on my client) and to be able to connect to my desktop (which I have available to web via DDNS). I'm not the best with networking, but I thought a way I could do this safely would be to set up XRDP connections through SSH. I think I have this working properly, but a requirement of this is still to allow SSH connection attempts from the open world.
I have configured my sshd to only accept key authentications (by setting sshd_config to have PubkeyAuthentication yes and PasswordAuthentication no), but obviously people could still try to initiate an SSH connection if they knew my URL.
I will also probably choose a random port to have my router port forward to 22, so that anything just probing 22 would miss, they would have to discover the port first.
Is there an easier way than this to feel safe about what I'm trying to do? Slash is it possible to really feel completely safe at all as long as my computer has any ports open to the wild wild web? I feel like I'm doing some common sense "security" by obfuscation, "don't be the lowest hanging fruit" kind of stuff, but still nervous someone might get in here and keylog me and get all my goodies.
Thanks for any thoughts or insight on this!
7
u/prof_of_memeology Apr 27 '22
The things you listed are a good start.
Of course the proper way to allow access to your home network, would be to use a VPN to tunnel in and then after that, use SSH to connect to your workstation.
Maybe your router has a VPN option you can use.
Also I would advice to activate IP tables on your box and further secure your SSH port like this for example:
This will drop everything by default and will limit new connections over SSH. If you reconnect too fast and use the wrong password/key it will DROP the connections. This will prevent probing and brute force attacks.
This is only one example. You can also consult google to find some tips on how to secure your services with IP tables.
Granted you already have "Key Auth only", but it's just an additional layer of security. Also your SSH Config might change or might get overwritten without you remembering or noticing. So it's always good to have a firewall running.
There is also Port Knocking. Which is a mechanism, which requires the user to knock on a secret sequence of ports, before opening the proper SSH port. Knockd is an example of this. But this would just require you to forward more ports. I wouldn't advice to use this. putting SSH on a non-default port should be enough obfuscation.
So to conclude: You should use a VPN in addition to all the other security practises and tips mentioned above. If a VPN is not possible at least configure your firewall properly.
4
u/gyarbij Apr 27 '22
My man just setup a vpn, maybe Wireguard on a pi or router if it supports it. You can then vpn into your network and not have ports open
1
u/watchoutitstaco Apr 28 '22
Thanks everyone for all the replies! I'm going to take some time setting some of this up (will probably do something like Tailscale unless I find a usecase of mine it doesn't support) and then I have to convince my partner this is all copacetic ;)
How would you all frame this? Yes, I am introducing an attack vector, but it's a well-secured vector, the benefits outweigh the risks, it's frequently done, I'm using a trusted solution (assuming I go with Tailscale), etc?
They are worried about their personal information being stolen because they had a brother get their SSN stolen and was totally boned. I get this fear from experience, but he probably got it from some human error, a bad decision or maybeeeee a bad password. Highly unlikely (I think) compared to other scenarios that his network was infiltrated and his info stolen that way.
3
u/jimmut Apr 28 '22 edited Apr 28 '22
Try AnyDesk if you just want remote access to your pc desktop. Easy. Secure if you setup strong password plus whitelist only to the other remote. Free for personal use.
0
u/[deleted] Apr 28 '22
[deleted] — view deleted comment