Ask HN: How to create a remote development environment?
I have a lot of laptops and desktops that I want to be able program from, and I have found using a repository like Github to be super frustrating. I have a couple of desktops that sit unused at my house that I could install Linux on to make as the development environment, but I have no idea how to make them accessible to the internet, so I can remote into them from anywhere. Once you have an SSH server installed, you will need to first disable password-based authentication (this is very important—even if you think you have a strong password, there are bots all over the internet just waiting for the chance). Then set up port forwarding on your router. To do this, go to your router settings and: 1. Set up a DHCP reservation for the server. This should be easy enough, but depending on your router you might have to look up the server's MAC address and set it manually. 2. Set up a port forwarding connection from the router settings. The internal IP should be the one you just reserved, port 22, and the external port should be pretty much anything but 22; I recommend choosing a random number from 10000 to 65535. 3. Now you can use it anywhere! Look up your public IP (https://duckduckgo.com/?q=what+is+my+ip&ia=answer) from your home network, and SSH into it like this: You can then access port 80 of the server securely with You should also look in your router config to see if it supports any dynamic DNS services. If it does, then you can register a domain name with most any domain registrar, get an account with the dynamic DNS service, and configure the domain registrar to use the dynamic DNS service's NameServers for your domain. I've glossed over the details quite a bit; the dynamic DNS service will probably have more detailed documentation. But basically what you're setting up is: 1. Your router will determine its public IP regularly, and tell the dynamic DNS service what it is. 2. The dynamic DNS service will update the mapping from your domain name to the correct IP address. 3. You'll be able to use your domain name instead of the IP address in the ssh command. Very handy if your IP changes when you're not at home, and can't look up your public IP. openssh-server will allow you to connect to the computers from anywhere. This will give you command line access, from there you can do anything. Use docker.
Last thing you need to do is set up the server with whatever stuff you want—gitlab or gogs for a github replacement, or anything really. ssh <username>@<public ip> -p <external port>
and go to localhost:<some port>/ in your browser while that session is open. Don't forward port 80 to another external port on your router because it will all go over the internet (not just your home network) in plain text. ssh <username>@<public ip> -p <external port> -L <some port>:localhost:80