238 points · by ingve · 2y ago · 159 comments
Also, test that it's properly disabled with something like `ssh -v yourserver : 2>&1 | grep continue`, because there are a surprising number of ways for that to go wrong (did you know that sshd lets you Include multiple config files together in a way that can override the main one? I know that now.)
The problems I hit with using Linux for this were different ten years ago, but, based on this thread, things got worse on that side of the fence.
Fwiw I don't think SSH adds the include line upstream. Most distros add it now.
it seriously bothered me that an update automatically re-enabled password authentication. i ended up switching to a different OS.
Find a dedicated server provider and rent the hardware. These companies rent some part of the datacenter (or sometimes build their own). Bonus points if they offer KVM - as in remote console, not the Linux hypervisor. Also ask if they do hardware monitoring and proactively replace the failed parts. All of this is still way cheaper than cloud. Usually with unmetered networking.
Way less hassle. They'll even take your existing stuff and put it into the same rack with the rented hardware.
The difference from cloud, apart from the price, is mainly that they have a sales rep instead of an API. And getting a server may take a from few hours to a few days. But in the end you get the same SSH login details you would get from a cloud provider.
Or, if you really want to just collocate your boxes, the providers offer "remote hands" service, so you can have geo-redundancy or just choose a better deal instead of one that's physically close to your place.
The boundary where colo and dedicated server offerings intersect in price tend to be down to land and power costs - Hetzner finally became the cheaper option for me as London land values skyrocketed relative to their locations in Germany, and colo prices with them. (We could have looked at coko somewhere remote, but the savings would've been too low to be worth it)
I used to have a short list of trustworthy companies like this I'd recommend to clients ~20 years ago when doing consulting. I think 3/4 of them have been gobbled up by private equity chop shops or are just gone.
Nowadays noone gets fired for going with AWS, or resold AWS with a 100% markup from a 'private enterprise cloud' provider.
drive to a few, and shake some hands. in my exp, the difference between colos is usually "actual SOC2/ISO compliance" on one side, and "there are no locked doors between the parking lot and my rack" on the other, with not much in-between that's not for some specialty (radio), and these things can only really be seen for yourself
Ideally, there’d be locked doors, and the data center wouldn’t be subsidizing performative checkboxing.
And for a lot of startups it really makes sense to use AWS. But if you do something resource or bandwidth intensive (and I'm not even talking about Llama now), the costs add up quickly. In our case, switching to AWS would increase our costs by an equivalent of 4 - 8 devs salaries. After AWS discounts. That's a hard sell in a 15-person team even though half of our infra costs already are with AWS (S3).
Gradually shift workloads, leaving anything requiring super-high durability last (optionally keeping S3, or competitors, as a backup storage option) as getting durability right is one of the more difficult things to get confidence in and most dangerous ones to get wrong.
Wrapping S3 with a write-through cache setup can often be the biggest cost win if your egress costs are high. Sometimes caching the entire dataset is worth it, sometimes just a small portion.
More important than raw uptime.
If you do happen to have a system without on-board KVM, check out NanoKVM, which is a cheap (~$40) option for an add on KVM. It's rather more affordable than PiKVM. https://github.com/sipeed/NanoKVM
There was a single security guard, I signed in and he gave me directions and a big keychain. The keys opened most of the rooms and most of the cages around the racks. To this day I remain mystified at the level of trust (or nonchalance) that security guard had in a spotty teenager.
With my director's unofficial approval I was allowed to _try_ to enter the datacenter. So I just walked very confidently towards the entrance, nodded to the security guard like all of the regulars who didn't bother showing their badges, and he let me in.
Quite a few of us in that era were juggling it with being students, so it wouldn't surprise me if the security staff were used to it and expected you to look young enough to be their kid!
To this day I can get into pretty much any rack or room I feel like at datacenters everyone here has heard of. It just takes experience these days and a bit of charm. Plus having a million keys and staff rack combination codes doesn't hurt. These were freely given and simply added to my collection over time, nothing stolen or social engineered.
I've never done anything nefarious with these abilities, and no one I know has either. It's simply a matter of practicality when you staff a 150,000 square foot facility with 2 security guards who have no idea what they are doing.
If I (and many others) had wanted to, we could have caused multi-week/month outages you'd be reading about on the news with 5 minutes of effort. This is basically the status quo for any sensitive industry.
The world turns because 99.9999% of people want to give you a hug vs. hit you. Society falls when that ratio goes much lower.
Actual criminal? Society will bend over to accommodate you.
" 1. Install Linux on the box. Turn everything off but sshd. Turn off password access to sshd. If you just locked yourself out of sshd because you didn't install ssh keys first, STOP HERE. You are not ready for this. "
If you blindly followed the directions and got locked out, you can do exactly the same thing with other directions. You were not ready.
Good instruction will tell you why and the consequences of missing a step. Perhaps some options.
But perhaps I want too much, the title does include the word "terrible," after all.
Seriously. Not knowing or remembering abut ssh keys is way below the minimum baseline of skills that are needed to manage a server connected to the internet.
Managing colo-ed servers when you're only just experienced enough to know about and know how to set up ssh keys without being told _is_ a terrible idea.
What is the reason NOT to educate me about SSH keys instead of just telling me to go home?
Everyone has to start somewhere.
That’s a strong indicator you won’t be able to support the setup moving forward. What if apt wedges some firewall rule, or the machine starts OOMing?
Or your user database full of PII gets popped.
Or your html/css/javascript gets modified to send all your supposedly secure Stripe checkout credit card details to eViLHackerz.ru
(Or your unmetered 1GBit network connection gets used to host p0rn or stage attacks for Mossad on hospitals and water utilities and power stations...)
I suspect the point of this article isn’t meant to be a Linux 101 guide, but rather, specifically about their learnings with how to go about colocating a linux server.
> But perhaps I want too much, the title does include the word "terrible," after all.
To be fair, it’s not actually a particularly good guide to how to go about getting your first colo server setup either, which aligns with their title about it being terrible.
Le sight.
First, open two superuser terminals. The second one is so if you fuck up the sudoers format so it doesn't parse and you accidentally 'exit' one too many times in the first terminal.
"visudo edits the sudoers file in a safe fashion..."
If your server/device has an IPMI... get a PiKVM (or like) anyways. Not only will you last more than 2 seconds without being hacked but it'll have more functionality and be much faster.
If you're in the US there are lots of places in the Kansas City area that have ridiculously cheap pricing and it's decently centrally located in the country.
Thanks, I had never heard of PiKVM!
TinyPilot's compare and contrast point of "To exercise the full functionality of PiKVM, users must install a custom circuit board on top of their motherboard and re-route their power supply's ATX pins." is a complete farce (it's not required) and worded in an intentionally scary way (the only reason TinyPilot doesn't have this requirement it doesn't offer the feature while PiKVM does). The "custom circuit board" is literally a PCB that, optionally, allows you to jumper the inline the remote power controls in a way that the normal power buttons still work too rather than rely on ACPI signalling over USB.
It honestly makes my blood boil to see this underhanded approach works so well... the TinyPilot device is good though, as are some other options. Just keep in mind if you opt to go with ACPI only remote power controls via USB things may still go bad if your system hangs/crashes/gets in a weird power state whereas plugging in the wires to the PiKVM will be no different than holding the power button.
I gladly do, and it's the best hosting experience I've had so far, and I used to have rented dedicated iron from Server4You, Hetzner, Webtropia and the like from 2005 on. Maybe there's a similar hidden gem in the area you live in, and you just do not know about it? :) Mine flew under my radar for nearly 20 years, and even though I knew they existed, I was not aware they'd colo other peoples' boxen at very fair rates.
The author of the post seems to be living in the bay area. It's easy when the number of nerds per km² is high, disposable income is even higher, and driving a car for 2 hours is considered "next door".
I think for losers like myself, living in the middle of nowhere with low disposable income, the best solution is just to rent out a dedicated Kimsufi box (from OVH), or a server off the Heztner auctions. (Or whatever is the equivalent in North America) It's much much more cost effective than collocating.
i remember the look in the admin's eyes when they asked "alright, what kind of hardware are you looking to install?" and I said "oh i have it right here" and pulled two Intel NUCs out of my backpack
> Consider bringing a screwdriver and a flashlight (any halfway decent place will provide those for you, but you never know).
two multitools minimum, sometimes you need to hold a nut with one while loosening the bolt with the other
the best space is the one that is right next to a Frys/Microcenter/whathaveyou
NUCs would be like nirvana after some of the jerry-rigged crap I've seen dragged into facilities. Maybe I'd like them to have a secondary power supply, but then again you had two, but they'd make a fantastic little router for something not too traffic heavy. Lots of utility use cases for something like that in a proper facility.
yup! it was cheaper to bring two NUCs than try to get N+1 power redundancy set up for "atypical" (not u-rack) systems :)
then they started making 1U NUC rack mounts...
> Plug everything in and turn it on.
Most server racks will have C13 or C19 outlets for power distribution. For consumer-type devices designed to plug into a wall socket, suitable cables or an adapter strip would probably be required.
For example, in ZFS you can mirror disks 1 and 2, while having 3 and 4 as hot spares with:
zpool create pool mirror $d1 $d2 spare $d3 $d4Also remember ask your provider to assign you a private vlan and vpn to it for your own access only.
Well, we could run decentralized systems at home for SMEs/Startup common needs from modern homes of remote workers, just renting them a room with proper local equipment the modern remote worker probably already have (VMC, A/C, "the big UPS" from domestic p.v.) with not much more expenses than using someone else computer also named "the cloud". Then if/when needs mount some sheds with p.v. + local storage and good connections can pops up. Who need a CDN in such setup? Then/if a real small datacenter could born.
Are you horrified? Well, now try to see the recent history, when Amazon choose not to buy expensive and reliable SUN servers choosing cheap and crappy PCs or Google choose to save money with rackmounted velcro-assembled PCs with a built-in UPS, i.e. a naked velcro strapped one. See the history of buying cheap low quality ram because we have ECC, lo quality storage because we have checksums anyway and so on. Then think about some real recent datacenter fires and what they told about "how brilliant and safe" was their design.
Long story short: as we ditch big iron in the past, we ditch mainframes, it's about time to think ditching dataceter model as well for a spread set of small unreliable but many machine rooms at homelabs scale. This, like FLOSS gives us reliability, cheapness and ownership as well. This ALSO decouple hw and sw giants, witch is a very good things in terms of free markets. It will also force he OEMs to be flexible in their design and ditching slowly from modern crappy fats-tech also some giants deprecate [2] as unsustainable, for more balanced tech because well, such homelabs last much longer than typical ready-made PCs and craptops or NAS from the mass distribution market.
[1] buying from China directly instead of feeding local importers who skyrocket the price instead of lowering it when Chinese supplier lower them
[2] https://unctad.org/system/files/official-document/der2024_en... of course suggesting the wrong answer
But yes, if you think you might want to add other machines later, preemptively putting a switch in there will make it tons easier.
When you have a better handle on what works for you, then go with colo (meaning you don't rent servers, but buy and setup your own servers and Ethernet switches, that go into your rack space).
The "clowns" are annoying as hell in their costs and dominance of CIOs, but there are distinct advantages of experimentation in clouds. Um, as long as it isn't your credit card...
But ipmi cards are little network-attached linux boxes which run prehistoric kernels and userspace, exposing as many services as the half-wits who put together the firmware image can shovel in, and are rarely if ever patched by the vendor unless there's some really public scandal.
The standard thing to do is to isolate them on some kind of private management network in an attempt to shield the wider internet from the full majesty of the firmware engineers' dazzling skills, but that might be harder to do in the simple 'beginner' scenario Rachel describes.
One good simple version when you get up to two servers instead of just one is to cross-connect so each machine has ipmi access to the other, but neither ipmi service is exposed to the wider world.
I've often wondered about actually replacing the kernel and userspace on the vendor BMCs themselves, to substitute something more competent, but I've not found anyone who's successfully done it.
As this document focuses on keeping things simple, they don't have the isolated network / VPN needed to use IPMI.
The equipment is all Dell with Enterprise DRAC, which is 90+% of my remote power needs. The only times I've needed to physically unplug them I also needed the power button on the machine held down for 30 seconds as part of what Dell calls the "FLEA drain" process, so remote power strips wouldn't help.
https://ussignal.com/uploads/general/Grand-Rapids-East-Data-...
I haven't rented any space in a while but I'm going to assume $400/month is about the cheapest that you would be able to get a half a cabinet.
And of course, that depends on how much bandwidth you need, how much power you need, are you running top-tier connectivity or something like Cogent/he.net...
1U rack space, including power, a 1Gb network uplink, and at least 1 dedicated IPv4 IP, is going to be at least $60-80/month, and even that would from small discount colo providers you have never heard of.
I guess I could leave them here at home and probably pay less in power than the total colo cost, but the bandwidth here at home is not great.
I know, I have one in the DC.
If they aren't packed there are probably some other options, more performant and having more storage now.
HE will give you a full cabinet for $600/month https://he.net/colocation.html?a=707336661752&n=g&m=e&k=hurr...
Don't do what I did and put a Cisco router on a remote mountaintop radio site with the config register still set to 0x2142, and then go home.
And if you failed to do this and all advices in the article: then kindly ask colo provider to attach ip-KVM (if your "server" is not actual server with ipmi/bmc), 99.9% of places have these. And most of them will provide it free of charge for limited amount of time.
Your house will have one connection to the outside work, the DC should have multiple for redundancy (In case a digger goes through your network connection), and same for power any good DC will have their own redundant power supplies (Batteries, generators etc).
And if your server is serving a lot of traffic, your consumer home ISP might not be too happy about it. Theres a reason they split plans between home and business.
Not really a serious argument, but maybe worth looking at this these days. Mostly because I think as engineers we all have the desire to hit 100% uptime and reliability when in a lot of cases "close enough" might be a lot further than you think.
On the power end, a lot of people are getting to some form of local generation and storage (e.g., solar + batteries). Small backup generators aren't entirely unheard of. And on the network end, I'm probably not the only person that went to multiple connections when my ability to earn income became tied to my ability to be online from home.
As it sits right now, my power's not the most reliable in the world but because of that I already have a fair sized generator and a lot of fuel stored on-site (~5 days of gasoline, ~10 days of propane). I'm directly off of a fairly regionally important power line, so I'm usually fairly high up on the priority list during any major outage. (I mean, not "hospital" but if my power's out so are tens of thousands of others generally.) My grid power's rarely out for that long, and my local power even less since I have the generator. If I finally got around to adding some solar and storage to bridge between grid going down and the generator firing up I'd be able to pretty comfortable ignore power outages for over a week before I started needing to worry about making trips out to dump fuel in the generator or calling for some propane.
As far as connectivity, I've got three connections across two providers. All my traffic hits a real data center first so I can bond the connections (because residential) then flows to and from my house. One of the providers is wireless so the only single point of failure for cut lines is a few feet in front of my router.
I'm well aware this gets nowhere close to the reliability of a data center. I wouldn't run anything safety or life critical this way. I wouldn't run anything making a substantial amount of money this way. But there's a lot of stuff that fits in below "successful SaaS" and "life critical" that I think could tolerate an hour of downtime here or there that would get along just fine like this. And even if you think "well, you're clearly an insane person no one else is going to do that" I think there's still lots yet that could tolerate a day or two of downtime every year or two just fine. There are a lot of smaller services out there that businesses rely on that are hosted in AWS but aren't much more reliable than if they were running in someone's basement and they survive just fine.
- If you want to send email from your server, you'll have a higher chance of it ending up in spam folders because of the residential IP.
- Home ISPs don't have SLAs. Your network was down for half a day without warning? Oh well. Things happen. We're sorry.
- Same goes for power, it's not as guaranteed at home as it is in a datacenter. Even if you install a UPS for your server, you can't be sure that the ISP's equipment will also work if you lose power.
Frequent IP changes and the residential IP block could make mail hard.
If I was looking to host something that mattered, and was a little more public, I would move that more for my own sanity. Not being able to find me via IP, network uptime guarantees, more robust backup power, etc.
If you were some cloud admin and put your website on a resume or something, and it was down, I might use that to jump to conclusions.
RIP Alchemy.
This was a tortured way to setup a colo. I bring rackable gear, no switch, and use the colo's "setup station" to do final config, then I rack the sucker. They can always VLAN me and my laptop together somewhere for a final check before I leave. I'd be worried if they couldn't.
Also you could see if your local hackers space has a server rack