Better HN
topnewbestaskshowjobs
Log inSign up

sidneythekidney

29 karma · joined Dec 31, 2023 (2y ago) · 16 submissions

Submissions

1.

Bluetooth2shell – One tap of pairing is all it takes(bluetooth2shell.com ↗)

3 points · by sidneythekidney · 2d ago · 3 comments

comment 2w ago · link · parent

Why not?

comment 2w ago · link · parent

Can you please elaborate on why this doesn’t work securely for resident keys?

I don’t use them personally. I like to tie ssh-keys to machines, so using non-resident keys always seemed like a good fit.

comment 2w ago · link · parent

Resident keys have their "metadata" stored on the yubikey, in an exportable way. This means using the same ssh-key on a different computer is as easy as plugging in the yubikey and typing ssh-keygen -K. With a non-resident key you’d have to copy the "privatekey", which contains the metadata needed to use the key, to the other computer first.

The downside with resident keys is that someone stealing the yubikey can see what resident keys are on it, and then possibly use those keys (if they aren’t protected). Newer firmware comes with ways to protect against this, but you’d have to enable it.

[1] has more details

1: https://developers.yubico.com/SSH/Securing_SSH_with_FIDO2.ht...

comment 2w ago · link · parent

You get this exact workflow if you use a passphrase on the -sk key, and add the key to your ssh-agent.

Edit: well, maybe not exact. With -sk keys you’d have to type in a passphrase instead of a pin. But that passphrase could be a pin.

comment 2w ago · link · parent

Fun!

I was able to reproduce this on Alpine 3.23.7 with OpenSSH_10.2p1.

Luckily PermitRootLogin [0] hasn't allowed logins with passwords for root since 2015 [1]. I'm guessing that's at least part of why this went undiscovered for so long.

0: https://man.openbsd.org/sshd_config#PermitRootLogin

1: https://cvsweb.openbsd.org/diff/src/usr.bin/ssh/sshd_config?...

comment 1mo ago · link · parent

I guess https://www.rfc-editor.org/rfc/rfc6762#appendix-G should be updated

comment 5mo ago · link · parent

Release-notes at <https://zsh.sourceforge.io/releases.html>

9.

Zsh 5.9.1 Released(zsh.org ↗)

5 points · by sidneythekidney · 5mo ago · 1 comment

comment 2y ago · link · parent

My curl complains when -J/--remote-header-name and -C/--continue-at is combined.

  $ curl -JLOC- "https://news.ycombinator.com/news.css?nZdOgS3Y18zj0ynCo50h"
  curl: --continue-at and --remote-header-name cannot be combined
  curl: try 'curl --help' or 'curl --manual' for more information

comment 2y ago · link · parent

Hah :)

You could try echo -ne '\ec' or echo -ne '\033c'. Or this from bash/readline:

  clear-display (M-C-l)
          Clear  the  screen  and,  if possible, the terminal's scrollback buffer, then redraw the current line, leaving the current line at the top of the screen.
But yea, this might depend on terminal as well

comment 2y ago · link · parent

If you only need to clear the screen, you may want to check out clear(1).

comment 2y ago · link · parent

Oops, I just remembered this, and I got the order of the last two files wrong. ${ZDOTDIR:-$HOME}/.zlogout is loaded before /etc/zlogout when logging out of a login session :)

comment 2y ago · link · parent

I set $PATH in ~/.zshenv. If you don't, you can't use any of your "extra stuff" in your zsh-scripts, as they do not use login or interactive sessions. And then I unset GLOBAL_RCS so the system configfiles don't override my settings.

In your guide, under ~/.zshenv, you mention that "macOS overrides this for PATH settings for interactive shells", without mentioning why or how. What's happening is that macOS sets your path in /etc/zprofile.

It seems your guide is missing a few global configfiles :) This is the order for an interactive login shell [1]:

  /etc/zshenv
  ${ZDOTDIR:-$HOME}/.zshenv
  /etc/zprofile                 (login)
  ${ZDOTDIR:-$HOME}/.zprofile   (login)
  /etc/zshrc                    (interactive)
  ${ZDOTDIR:-$HOME}/.zshrc      (interactive)
  /etc/zlogin                   (login)
  ${ZDOTDIR:-$HOME}/.zlogin     (login)
  /etc/zlogout                  (login - loaded on logout)
  ${ZDOTDIR:-$HOME}/.zlogout    (login - loaded on logout)
In fact, the configfiles you mention are only loaded the way you've mentioned them, if the option GLOBAL_RCS is unset. And if GLOBAL_RCS is unset, macOS does not override your PATH, because/etc/zprofile is not loaded :)

1: <https://zsh.sourceforge.io/Doc/Release/Files.html>