Live data from Hacker News

🥺: the best sudo replacement

xeiaso.net

511–520 of 559 posts

Re: 🥺: the best sudo replacement

#511

I feel obliged to mention doas[1], which is a sudo alternative from openBSD. It is written in c, but tries to be smaller and easier to configure. I am not qualified to vouch for or against it, but it is interesting. 1: https://man.openbsd.org/doas

My existence is split between OpenBSD and Linux. What I really want is OpenBSD than runs Steam and Proton—nothing more.

OpenBSD has maintained exceptionally good taste when it comes to change. When they rip out and replace a "classic" utility, they invariably make a modern classic: openssh, pf, doas

When others rip out a system and replace wholesale, they often just do the hard work to secure the existing thing: Wayland vs. Xenocara

I don't know that there's any objective way to know ahead of time whether replacement or repair is the right approach. But the fact that such a relatively small project such as OpenBSD has managed such outsized positive impact across the open source landscape speaks volumes to their intuitions here.

Re: 🥺: the best sudo replacement

#512

I feel obliged to mention doas[1], which is a sudo alternative from openBSD. It is written in c, but tries to be smaller and easier to configure. I am not qualified to vouch for or against it, but it is interesting. 1: https://man.openbsd.org/doas

I noticed and enjoy that both sudo and doas use each side of a standard qwerty keyboard to type, though doas uses 3 keys on the left while sudo has two on the left and two on the right. It made the transition a little easier for my muscle memory.

I mapped ^S in zsh to toggle "doas" at the start of the line:

  # Toggle "doas" at the start.
  toggle-doas() {
      [[ "${BUFFER:0:4}" = "doas" ]] &&
          {CURSOR+=-5; BUFFER="${BUFFER:5}";} ||
          {BUFFER="doas $BUFFER"; CURSOR+=5;}
  }
  zle -N toggle-doas toggle-doas && bindkey '^s' toggle-doas
Even less typing!

Re: 🥺: the best sudo replacement

#513

Earlier quoted context omitted.

The are quite a lot of "gotchas" with passwords being Unicode though. One of my favourite tricks is to include a null byte in passwords and see what happens. Sudo treats it as the end of the string. Passwd gives "token manipulation error" and nopes out. Many websites seem to fail in interesting ways...

I've run into a service where having a password longer than 15 characters _truncates_ it but the password change dialog does not so it's stuck in limbo.

This was, at least a few years ago, the case with Blizzard's Battle.net passwords. I picked a nice secure passphrase, but had to cut it off mid-word because of this truncation. (I think the behavior was for it simply to take the first 16 characters of whatever you typed in the password field, so typing the full passphrase didn't fail, but I wasn't confident that that would remain true in all cases, so I made a habit of only typing the first 16 chars.)

Re: 🥺: the best sudo replacement

#514
post #493

Earlier quoted context omitted.

I was thinking the same. But then I thought about it more and wondered why you need to enter your own password if you're already logged on. If an attacker is already in the system, it can install key logger and whatnot without the root password. And the xn--ts9h program can have the Unix permission so that only the user can run it.

There is the mental function signalling "hang on, you're about to do something unsafe. Are you sure you want to do this?" But I think there are some scenarios where it serves a practical security purpose as well: - You're in an office, went away to grab a coffee and left the screen unlocked (bad!). Without sudo, a malicious person could indeed quickly install a backdoor or keylogger and take over your system. - you'r…

If I'm not mistaken, especially with x11, it is trivial to install a keylogger without root password. Just a process in the background that listen to your keys and send them over the wire. (And you can add that program in the list of program to run while logging in)

Re: 🥺: the best sudo replacement

#515
post #361

Earlier quoted context omitted.

I wouldn't call that "being Unicode" though, since null byte is in ASCII.

It depends on the encoding: In UTF-16, a lot of characters have 0x00 as part of their encoding. That's the null byte, even if the software isn't technically supposed to see it that way, so it's a valid test. (Easy, too: Any character that's also in ASCII will be represented with a 0x00 byte in UTF-16.) Of course, UTF-8 solves that problem, plus the problem of surrogate pairs.

> That's the null byte, even if the software isn't technically supposed to see it that way

that's a null byte, even if the spec says it's not the string terminator.

i just think it's worth referring to things by using words that more precise semantics if possible

Re: 🥺: the best sudo replacement

#516
post #459
post #380

Earlier quoted context omitted.

Ah yes, because every joke becomes better when you announce that it's a joke.

I dislike it too. It’s typically unnecessary on hn because it’s well moderated and people often seem nice even when passionately disagreeing. But on the wider internet everyone assumes you’re stupid. So the “/s” becomes a safety measure. Also read once that it’s an accessibility thing. But I’m not sure if that’s true.

Usually the majority gets it. And the worst that can happen is that some people will downvote you, or call you an idiot. I'm not especially concerned about this.

I don't see how it's an accessibility issue, except to help out those with a deficient sense of humour.

Re: 🥺: the best sudo replacement

#517
post #290

Earlier quoted context omitted.

Check the =nil; Foundation. All of their products have really weird names. Their db service is called `DROP DATABASE * https://nil.foundation/

So there's actually a cool thing in the blockchain space. Nice.

There’s a number of cool things but you need to know where to look for :)

Re: 🥺: the best sudo replacement

#518
post #516
post #459

Earlier quoted context omitted.

I dislike it too. It’s typically unnecessary on hn because it’s well moderated and people often seem nice even when passionately disagreeing. But on the wider internet everyone assumes you’re stupid. So the “/s” becomes a safety measure. Also read once that it’s an accessibility thing. But I’m not sure if that’s true.

Usually the majority gets it. And the worst that can happen is that some people will downvote you, or call you an idiot. I'm not especially concerned about this. I don't see how it's an accessibility issue, except to help out those with a deficient sense of humour.

regarding accessibility..from what I have heard, other cultures have much different styles of sarcasm which might impede their ability to understand that something you have said is sarcastic. e.g. Japan is known to have a reputation of not understanding American sarcasm, but has it's own style of sarcasm. (see https://linguaholic.com/linguablog/sarcasm-in-japanese/)

so, I guess announcing your sarcasm makes sense in an international accessibility sense, particularly when some of the normal cues are not present (tone of voice, facial expression, eyes rolling)

Re: 🥺: the best sudo replacement

#520

Earlier quoted context omitted.

I was thinking the same. But then I thought about it more and wondered why you need to enter your own password if you're already logged on. If an attacker is already in the system, it can install key logger and whatnot without the root password. And the xn--ts9h program can have the Unix permission so that only the user can run it.

Insider threat, attacker not in the system, you leave your terminal unlocked and are away. Someone walks passed and tries to install something from you terminal?

While it leads to slightly more chance of traceability, I've seen one line "curl | sh" which install a tool which transmit everything you type, or just your password (when you next type it) off to a remote server, so once you've left a terminal unattended you are in trouble anyway.

This is one place when windows can be much better, as users can't catch ctrl+alt+del, so you can always press that before logging in.

Post reply on HN