6 ms·
Password based ssh authentication should be used approximately never.
by eklitzke 3y ago
Password based ssh authentication should be used approximately never.
- tsbinz 3y agoThat is not the only time you use passwords over ssh, e.g. I don't use a password to remote into my desktop from my laptop, but I do use one when using sudo on the desktop.
- vladvasiliu 3y agoIs there no way to forward fido tokens? Or the GPG agent with a Yubikey. Under Windows, you can forward your smartcard over remote desktop. It's one of the few things Windows has I miss on Linux.
- 2Gkashmiri 3y agoi attempt to use this and some programs recognize this and many just don't
- vladvasiliu 3y agoDon't these apps just use PAM? Since the initial complaint was about sudo, I'd figure pam / polkit would handle this, and apps would call those to obtain privilege elevation.
- ptman 3y agoForwarding the ssh agent (-A) is considered insecure. Instead man ssh recommends using a jump host (-J)
- vladvasiliu 3y agoI was talking about the GPG agent, so that the key on the smart card can be used to for sudo elevation on the remote host. This usually requires user interaction with the key, so just having access to the agent wouldn't do much. I don't think the ssh agent would help with this. To your point, I wonder whether that consideration holds when the private key is held on an external device, like is the case with a YubiKey. I use that setup, and I can't add the key to the ssh agent. $ ssh-add .ssh/id_yubikey_gpg.pub Error loading key ".ssh/id_yubikey_gpg.pub": error in libcrypto SSH connections work fine with that key.
- ehutch79 3y agoThat's not what the parent is talking about. They're specifically refering to password authentication to make the ssh connection.
- rollcat 3y agoActually this is something that is relevant to my interests. I prefer to have sudo ask for a password when I'm physically in front of the machine, but not if it's a remote session (e.g. SSH from my laptop to my desktop). Maybe the SSH agent on the client can re-authenticate to the server when requested?
- patrakov 3y ago> Maybe the SSH agent on the client can re-authenticate to the server when requested? There is a PAM module that does this: https://github.com/jbeverly/pam_ssh_agent_auth https://github.com/jbeverly/pam_ssh_agent_auth Note that this is a bad idea from the security standpoint, as it requires SSH agent forwarding. Which means that, if the remote server is compromised, the attacker can use your SSH agent to log into other servers as you.
- rollcat 3y agoThe local agent can ask the user to approve/deny signing requests.
- riffraff 3y agoFWIW, you can probably configure sudo to use something other than passwords. On a Mac you can use the fingerprint reader for example, it's just disabled by default. And your terminal may come with a password manager too, which would be unlocked with whatever means. Again, on a Mac with iTerm you can do this with a fingerprint.
- marginalia_nu 3y agoHow would you log in for the first time into a headless device?
- Filligree 3y agoI'd use a base image with a baked-in SSH certificate allowed. Fairly trivial to make, at least with NixOS.
- marginalia_nu 3y agoThis hinges on this being either a VM or some hardware you've set up yourself.
- booi 3y agowhat other situation would you be in?
- fragmede 3y agoAny device where you don't control the initial firmware, and the firmware doesn't support ssh keys. AP/Routers (consumer and commercial and industrial grade), Shared hosting with ssh but limited features (eg GoDaddy)...
- nine_k 3y agoFor physical devices, you can usually connect them via a dedicated Ethernet cable right to your laptop, and set the initial password. They likely don't have the right network settings anyway to drop them right into the bigger LAN. Otherwise I think you just prepare a certificate ahead of time, and scp it during the first connection, then immediately disable password-based access, or at least change the password. Any passive eavesdropping still needs to defeat the encryption somehow (no feasible ways are known now), even having seen the initial exchange. If you have an active MITM attack, all bets are off, because the attacker could even grab the image with the pre-baked key you're sending, and copy or change the key. If this is not possible, then the pre-baked key would help. If your security is really important, don't use ther cheap GoDaddy's offerings with limited SSH.
- deleted 3y ago[deleted]
- Filligree 3y agowe're not necessarily talking about ssh authentication. Wouldn't that send the entire password as a single packet, anyway?
- djmdjm 3y agocorrect - this is for the post-auth session and not the authentication phase
- glitchc 3y agoThis is naive in the extreme. There are many scenarios where passwords are needed, for bootstrapping, a disgruntled admin leaving, etc. There is a role for a common secret in a secure ecosystem (password, passkey)
- scarby2 3y agoThat common secret is usually an ssh key which is held somewhere secure hopefully with auditable access. For bootstrapping you can bake a bootstrapping key into your installer which is removed after the system is configured.
- djmdjm 3y agoThis is completely irrelevant to password based SSH authentication. The timing obfuscation is for the session _after_ authentication.