by hsbauauvhabzb · 4y ago · 0 comments
This is uncontexualized hype clearly written by someone with no real world experience, hoping to gaslight users into thinking their current system is insecure. Then I scroll up and noticed the article is written by a company who sell presumably consulting services in unix. Go figure.
Failing that, there’s limited reasons to use BSD systems instead of Linux unless you have highly specialised requirements. Under many cases I’d imagine it would be more expensive in terms of effort required to hire/train skilled staff.
Basically I ended up using the Freebsd box as a fileserver (ZFS and Minio), and still running an Alpine Linux box with zfs for most other things.
I did briefly run a Minecraft server on the Freebsd box which worked really well.
Virtual network for a bunch of jails with nat. I wanted exposed ports on the host machine mapped to a reverse proxy jail that did tls termination before forwarding to other jails on a virtual network (while allowing the jails on the virtual net outgoing internet access).
Several applications that were apparently built for Linux, so they did not compile on Freebsd (and no alternatives available).
Getting newer versions of software. Often the version available in pkg is several major versions out of date.
Documentation for how to do things in general. Yeah when there are docs/tutorials they can often be of high quality, but frequently there is just nothing or the available docs does not cover the edge case you are trying to solve.
Jails are old, and there's a wealth of outdated documentation around which makes it confusing when trying to understand how things works.
In case someone else is reading this, it's not different from what Docker does automatically for you.
I typically use vnet (which gives the jail an entire virtualized network stack, something like macvlan?) and either use NAT or bridges for connectivity. NAT for machines with only one public IP (like VPSes) and bridges for homelab setup where I want a more visible setup.
When setting up NAT I just use PF as my firewall, and assign static addresses to each jail.
That's really a bit of a pain (lack of a good tutorial/doc)
>Virtual network for a bunch of jails with nat.
I solved that this way: Create'd a vnet haproxy-jail (the tls-terminator and "forwarder") all other jail's a "non-vnet" with a internal IP.
But you can do it with just nat'd jails and haproxy as the terminator...no problem, do you need some pf examples?
>Getting newer versions of software. Often the version available in pkg is several major versions out of date.
Same on Linux-Distros, freebsd is pretty much on par:
https://repology.org/repositories/statistics
>Documentation for how to do things in general. Yeah when there are docs/tutorials they can often be of high quality, but frequently there is just nothing or the available docs does not cover the edge case you are trying to solve.
Can you give some examples so one could do something against it? NFSv4 with kerb and ldap is one..i know ;)
There's a PR hopefully landing soon in nixpkgs to add freebsd building: https://github.com/NixOS/nixpkgs/pull/82131
I was wondering if there's a builder at some point, it may improve the compatibility for the whole ecosystem. There's definitely a lot of fixes going upstream from darwin build failures.
The default settings for pkg use the quarterly branch. Remove the comment from the line for using the latest branch in /usr/local/etc/pkg/repos/FreeBSD.conf.
I mean, https://nvd.nist.gov/vuln/detail/CVE-2022-43995 is lest than a week old, so probably yes. (That is, a lot of systems haven't been updated and have a nice open CVE that wouldn't be there if they weren't using sudo.)
Furthermore, there would be no vulnerabilities if you just unplug your computer and walk away, at some point you need to make usability and risk compromises.
Furthermore, the UNIX user model and file system hierarchy already provides you with RBAC. Combine that with ACLs and SetUID (et al) bits and you’ve already got sudo baked into the core system.
Your point about it being a convenience tool is bang on: it makes it easier to administer all of the above but that convenience, like nearly all convenience tools in computing, comes with a slight security trade off.
To be clear, I don’t agree with the author’s recommendation to ditch sudo. But they are absolutely correct in the technical sense. Just as you are. In fact you are both basically arguing the same point but from different perspectives: “sudo adds a vector of attack”. It’s then up to your threat modelling to decide if that is appropriate or not.
But to come back to my original point: just don’t give people shell access. There’s no need in 99% of cases of servers these days and if we are talking about local user machines, then RBAC is less of an issue since it would be a machine per user.
Some folks kind of are; for instance, last time I looked Arch Linux has sudo as part of base so it's hard to remove.
Edit: Sorry, apparently Arch does let you remove sudo (now?). If you substitute in RHEL et al. the general point stands (and I actually checked this time and Rocky 8 makes unhappy noises if you ask it to remove sudo), but my initial example was wrong.
$ yay -Rsn sudo
checking dependencies...
:: libisoburn optionally requires sudo: for use with xorriso-dd-target
:: pacman-contrib optionally requires sudo: privilege elevation for several scripts
:: refind optionally requires sudo: for privilege elevation in refind-install and refind-mkdefault
:: wireguard-tools optionally requires sudo: elevate privileges
:: yay optionally requires sudo: privilege elevation
Package (1) Old Version Net Change
sudo 1.9.12.p1-1 -7.10 MiB
Total Removed Size: 7.10 MiB
:: Do you want to remove these packages? [Y/n]
:: Processing package changes...
(1/1) removing sudo [###############################################] 100%
:: Running post-transaction hooks...
(1/2) Reloading system manager configuration...
(2/2) Arming ConditionNeedsUpdate...
libisoburn, refind, wg, yay can be elevated by doas or su.pacman-contrib is a bunch of package development scripts. Your typical user won't have them. Also the previous point applies.
Looks like nothing else in core depends on sudo, most packages from extra/community that need it have it as an optional dependency, looks like one can remove sudo on Arch
Arch's base is really minimalist, though.
And yet just a few days ago there was a thread about sudo's recent heap-overflow issue, where the top comment's first line is:
> Sudo must be the program with the largest number of buffer overflows I’ve heard about.
* https://news.ycombinator.com/item?id=33465707#unv_33467000
Aside from what the problems and benefits of sudo may or may not be, bringing up sudo in a "BSD vs. Linux" debate is a red herring: it's just completely unrelated.
Sudo -e FILE opens a copy of the file with $EDITOR and then moves copy to replace FILE
Tramp opens a file including present buffer and writes it as root to achieve the same effect.
EDIT Tramp now works correctly for me sudo -e is simple enough to script looks like a winner for simple things when complex isn't required
I'd expect you'd need more training for Linux, since it changes more often.
During this time frame we've also migrated our last FreeBSD servers to Ubuntu
Except for the giant, buggy change in the auto-install process in 20.04:
* https://utcc.utoronto.ca/~cks/space/blog/linux/Ubuntu2004Aut...
Ubuntu's documentation, and lots of third party documentation targeting ubuntu, is like 10 years out of date for lots of things anyways, and even when it _works_ often gives bad advice that either was never true or hasn't been true for years.
From my perspective, it's not changed much too - I was using apt-get install nginx - I keep using it. Was using systemctl - keep using it. Cannot say I've adjusted my habits during that moves.
Ah, home dirs are property secured now.
You know, I actually set this comment aside because I was curious about how HN would engage with it. So far, it seems like folks are pointing out that there indeed have been changes in certain aspects of the OS, as well as probably the introduction of the whole snap mechanism.
Regardless, to me Ubuntu LTS seems like one of the better OS distros out there, both for desktop and server use. It's not ideal, but it's good enough in most respects, to the point where it's hard to recommend anything else.
Previously I recall many looking in the direction of CentOS as something to install on servers and have it serve them for a long time with security updates and pretty good stability, but I guess now one would have to count on Rocky Linux and Alma Linux for that. Additionally, I have to admit that some of the choices that RPM distros make can be a bit odd and the software support isn't where I'd like it to be, things like Docker were admittedly broken (DNS resolution, firewall masquerades and other oddness with SELinux) for a while. It feels like they have their own enterprise-focused way of doing everything, OpenShift being an example of this.
On the other hand, there's Debian and Ubuntu. Personally, I might even like Debian better, but Ubuntu's LTS lifecycle is far more worry free. You might not get 10 years of support, but setting up something and running it for 5 years (with security and other updates) is pretty freeing, especially when you're primarily interested in just keeping things running in a stable manner and don't always need the latest packages. There are changes, of course, there are packages that change names, that break or are deprecated, sometimes you get other growing pains that all of the OSes out there need to deal with.
But Ubuntu LTS to me feels like it's good enough for both server use in both development/testing/prod, as well as personal use, as a daily driver.
I actually will stand by that statement, recently I moved to building all of my container images on Ubuntu as a base: https://blog.kronis.dev/articles/using-ubuntu-as-the-base-fo...
I also experimented with running an offshoot of it, Linux Mint, on the desktop (because their XFCE spin is great): https://blog.kronis.dev/articles/a-week-of-linux-instead-of-...
And nowadays I'm considering migrating my Debian servers after the EOL to Ubuntu, my new ones already running it.
I will say that every distro has its place and in certain domains there are better options than Ubuntu, of course, and OSes like the *BSDs have consistency and engineering that Linux cannot quite match (due to the "engineered vs grown" approach to building them), but sometimes you just want something that is simple to run, has ample tutorials and resources, and won't make you chase down odd issues.
Linux wins in terms of market share which makes it appear easier (eg more software support, bore install guides, etc). But if you look at the base OS itself, FreeBSD is a lot more consistent to manage.
I think it’s a great pity FreeBSD doesn’t get more traction to be honest with you. I have no major qualms with Linux on the whole but FreeBSD is a really nice platform to work on too.
A how-to for FreeBSD can be used with NetBSD with minimal changes. Why? Because the BSDs don't expend effort to deliberately try to differentiate themselves from each other. They're consistent and don't change gratuitously.
Try writing a how-to that has even the slightest consistency between the common Linux distros - Red Hat, Ubuntu, Debian, Arch. Heck - many how-tos written for Ubuntu 18 can't be used with newer Ubuntu! It's a mess.
On practical side it rarely bothers you. In most organizations you standardize on single one and that's all.
Say my largest current Linux deployment is on Centos 7. Project is new so just for 3 years.
Migration will highly likely will happen to Alma 9 (RHEL 9 clone) somewhere next year. And will run another 5 years or so.
I've been using NetBSD for about the same amount of time, and it hasn't changed all that much either.
However, when using a system without a GUI, e.g. for a networking or storage server, in most cases FreeBSD is definitely much easier to use than Linux.
There are a huge number of small details that matter. Even for something as simple as seeing the status of the network interfaces. If I type "ifconfig" without arguments on FreeBSD, it shows everything that I want to know, about all network interfaces. To obtain the same information on a Linux system, I have to type a large number of "ip" commands, each with many arguments that I fail to remember even after decades of using "ip", so I may need to consult the "man" page for "ip". (The legacy ifconfig of Linux does not provide the functionality of FreeBSD ifconfig)
In general, for any network-related task, using ifconfig and ipfw on FreeBSD is much easier than using ip and iptables on Linux.
There also many more niche applications where there are big differences. For example the "mt" command for magnetic tape control sucks badly on Linux, but it is very convenient on FreeBSD. Also for SCSI devices FreeBSD has more flexible commands.
While audio seems to be improving on Linux with things like pipewire, for a long time audio was in many cases easier to configure on FreeBSD than on Linux with the dreaded ALSA or pulseaudio, if the audio hardware was supported. Also, when I had to configure once some USB surveillance cameras, that was easier on FreeBSD with webcamd, than on Linux, but like for audio, FreeBSD has a shorter list of supported devices.
Some of the differences in the user interface between FreeBSD and Linux are caused by FreeBSD being more conservative, while in Linux some older tools have been replaced with newer tools, but the newer tools have been made with worse user interfaces, like in the replacement of ifconfig with ip, or in the introduction of ALSA and pulseaudio, which both have an extremely poor user interface, especially for computers with multiple audio devices.
I'd prefer it if there was one favored one that all the effort went into to make it really good, just like with everything else FreeBSD. This is not arch where you have to handpick each component :)
Not even mentioning nowdays Linux is largely just layer to run docker and noone cares on learning things beyond docker-compose and docker files.
So typical for BSD fans, find a single flaw then try overblow it and show how their flavour of *BSD is better. It's frankly tiring at this point.
Please don’t make generalisations about peoples character.