Live data from Hacker News

ssh whoami.filippo.io

words.filippo.io

71–80 of 90 posts

Re: ssh whoami.filippo.io

#71

I think a lot of people in the comments are missing the fact that public keys are by default intended to be public . This is an explicit and intended property of private-public key cryptography. Your public keys are not a security boundary and setting `IdentitiesOnly` in your SSH configuration does not do anything to strengthen your security posture.

[deleted]

Re: ssh whoami.filippo.io

#72
post #31

Before SSH-ing into untrusted hosts, make sure you understand what SSH agent-forwarding and X11-forwarding are. Also, maybe don't trust the SSH config defaults on whatever host you're on at the moment. You can explicitly set defaults yourself in your `~/.ssh/config` or similar.

>SSH agent-forwarding and X11-forwarding Are they enabled by default when running SSH?

No, disabled by default

Re: ssh whoami.filippo.io

#73
If you need a local & offline first tool to log/track/archive changes from all kind of git repos yourself, from:

* github.com * sourcehut (sr.ht) * gitlab.com * codeberg.org * ...

published ssh keys & changes, to verify (offline) ssh signed commits, verify, encrypt mails, exchchange secure data (age-enc).

You can use this app:

[] https://github.com/paepckehh/gitkeys

If you want your own repos public keys tracked / monitored / archived, just leave a star:

[] https://github.com/paepckehh/keys

Re: ssh whoami.filippo.io

#74

I have been circumventing this issue purely by accident it seems. I have always had ssh-keygen write out the keys to a custom path like ~/.ssh/keys/$service/$key{,.pub} and configured each host's "identity" manually with the ssh config file. I never did this for security purposes or anything, I just thought it made more sense than the default behavior.

[dead]

Re: ssh whoami.filippo.io

#76
post #40

I learned about this when I encountered a server with an aggressive fail2ban that wouldn't let me log in because I had too many ssh keys. It apparently counted every wrong key as an auth attempt, so it blocked me before my ssh client tried the right key. Since then I've used IdentitiesOnly=yes

Just add the good key to the ssh config file on the client:

IdentityFile ~/.ssh/some.key

Re: ssh whoami.filippo.io

#77
post #31

Before SSH-ing into untrusted hosts, make sure you understand what SSH agent-forwarding and X11-forwarding are. Also, maybe don't trust the SSH config defaults on whatever host you're on at the moment. You can explicitly set defaults yourself in your `~/.ssh/config` or similar.

> ... make sure you understand ... SSH agent-forwarding ...

And how to configure your ssh agent to confirm with you on each use. See `-c` in `ssh-add(1)`, and make sure you're using an agent that supports it (GNOME's Seahorse doesn't, gpg-agent does, macOS's ssh-agent doesn't make can be made to via some AppleScript).

Because my ssh agent confirms each key use, I enable agent forwarding on every ssh connection without fear.

Re: ssh whoami.filippo.io

#78
> The first is that the SSH protocol provides to the server all public keys the client is willing to produce signatures for, which by default are all the public keys in your ssh-agent and in your ~/.ssh/id_*.

Not sure about other systems, but this isn't the default on Debian. I, at least, start every day by running `ssh-add ~/.ssh/id_whatever_service_I_want_to_auth_to`, because it doesn't do it by itself, and I was too lazy to configure it. For the same reason, the party trick didn't work here, since I haven't had to commit anything today yet ...

Re: ssh whoami.filippo.io

#79
post #34
post #28

Earlier quoted context omitted.

The downside is that if you use a large range of servers, you will have to configure them to tell SSH what identities to use. This can be cumbersome if you ssh by alias (e.g. 'foo' rather than 'foo.yourcompany.com'). If you only SSH into servers you trust (a sensible practice) then the benefit is marginal.

Note that it does accept wildcards so you can do rules for *.mycompany.com You can also use placeholders for keys, so for example I have a ssh config like: Host *.mycompany.com # Employer specific yubikey stuff Host *.mydomain.com IdentityFile ~/.ssh/keys/id_primary Host * IdentitiesOnly yes IdentityFile ~/.ssh/keys/%r@%h # uses ~/.ssh/keys/git@github.com for github for example I originally started doing this because…

Nice tip about the placeholder, I will steal that. Thanks.
Post reply on HN