One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (2024)


One safety tip: disable SSH Agent Forwarding before you connect, otherwise the remote server can theoretically reuse your private key to establish new connections to GitHub.com or prod servers (though this host is unlikely malicious).

https://www.clockwork.com/insights/ssh-agent-hijacking/ (SSH Agent Hijacking)

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (1)

fragmede 4 months ago | next [–]


The full command you want is:

 ssh -a -i /dev/null terminal.shop

to disable agent forwarding, as well as to not share your ssh public key with them, but that's just a little less slick than saying just:

 ssh terminal.shop

to connect.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (2)

glennpratt 4 months ago | parent | next [–]


I'm curious why you added `-i /dev/null`. IIUC, this doesn't remove ssh-agent keys.

If you want to make sure no keys are offered, you'd want:

 ssh -a -o IdentitiesOnly=yes terminal. Shop

I'm not sure if the `-i` actually prevents anything, I believe things other than /dev/null will still be tried in sequence.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (3)

fragmede 4 months ago | root | parent | next [–]


Check for yourself with

 ssh -v -i /dev/null terminal.shop

vs

 ssh -v terminal.shop

What you're looking for is that there is no line that says something like

 debug1: Offering public key: /Users/fragmede/.ssh/id_rsa RSA SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Upon further testing, the full command you want is:

 ssh -a -i /dev/null -o IdentityAgent=/dev/null terminal.shop

to forcibly disable a local identity agent from offering up its identities as well, and not just agent forwarding.

Upon further testing,

 ssh -o IdentitiesOnly=yes terminal.shop

still offers up my public key on my system (macOS, OpenSSH_9.6p1, LibreSSL 3.3.6), contrary to what StackOverflow and the Internet seems to think. Tested by hitting whoami.filippo.io, linked in child comment.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (4)

glennpratt 4 months ago | root | parent | next [–]


Aha, yes, `-o IdentityAgent=/dev/null` is better for my intent. I was confused that `-i` wasn't removing .ssh/id_rsa from the candidates, but that was ssh-agent.

 ssh -a -i /dev/null -o IdentityAgent=/dev/null terminal.shop

That looks pretty solid. Thanks!

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (5)

Jenda_ 4 months ago | root | parent | prev | next [–]


For a cool example (deanonymization), see https://words.filippo.io/dispatches/whoami-updated/ (discussed at time: https://news.ycombinator.com/item?id=34301768). Someone has crawled public keys from GitHub (tbh I was surprised that GitHub publishes them) and set up a database.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (6)

fragmede 4 months ago | root | parent | next [–]


It's quite useful! I can give someone access to my server by grabbing their public key and creating an account for them, no need figure out how to send them the password to my server.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (7)

ddalex 4 months ago | root | parent | next [–]


That's indeed how public keys are intended to work.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (8)

fragmede 4 months ago | root | parent | next [–]


It's one of those obvious in hindsight things that gives me that "Internet was not a mistake" feels.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (9)

CoolCold 4 months ago | root | parent | prev | next [–]


Gitlab does the same.

I've seen provisioning scripts and even cloud-init if I'm not wrong supporting downloading keys in that manner.

From one side it's cool from other side allows to bypass of system administrator for keys update more easily.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (10)

philsnow 4 months ago | root | parent | prev | next [–]


> You can make a search for all users, which will tell you there are 97,616,627 users at the time of this writing, but you can only fetch at most 1000 results from a search, and they don’t come in any clear order, so you can’t just make the next search start where the previous one left off (or I didn’t figure out how).

> What you can do though is request accounts created in a certain time range. If you get the time range right, so that it has less than 1000 entries, you can paginate through it, and then request the next time range.

This reminds me of when I tried to add a google drive storage backend to camlistore/perkeep (because I had nearly-unlimited free quota at the time). One of the things a perkeep blobserver needs to be able to do enumerate all the blobs it has, in order. You can send millions of blobs to google drive without issue, but you can't directly paginate a search for them in sorted order.

You could just issue a search for all blobs under your perkeep drive folder, keep paginating the result until you run out of pages, and then sort in memory, but there's really no way of knowing how many blobs you're going to end up with and you might blow out your blobserver's memory.

Perkeep blobs are identified by blobrefs, SHA sums of the contents of the blob, so they look like sha-[0-9a-f]{64}. Google drive lets you search for files with a name prefix, so you can search for like /perkeep/sha-* and see if the result has a pagination token (indicating that there are more than 1000 results), and if so then you search for each of /perkeep/sha-0*, /perkeep/sha-1*, ... , /perkeep/sha-f*, each time checking to see whether there are too many matches. When there's not too many matches, you've found the prefix length that will let you fetch a bounded number of blobrefs, emit them to the perkeep client, and then release the memory before fetching more.

 /pk/sha-\* 1000+ results (non-empty pagination token) /pk/sha-0\* 1000+ results (non-empty pagination token) /pk/sha-00\* 1000+ results (non-empty pagination token) /pk/sha-000\* 193 results, sort these in memory and emit to client /pk/sha-001\* 179 results, sort these in memory and emit to client ... /pk/sha-fff\* 223 results, sort these in memory and emit to client

I didn't end up landing the patch before I lost interest, partly because it was pretty much the first golang I had tried writing. It was fun working out the above details, though.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (11)

robertlagrant 4 months ago | root | parent | next [–]


> I tried to add a google drive storage backend to camlistore/perkeep (because I had nearly-unlimited free quota at the time)

This explains the quotas now :)

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (12)

arghwhat 4 months ago | root | parent | prev | next [–]


Offering your public key only allows them to identify the key and prove you have it. There is no security concern in sending this to an untrusted server.

Agent forwarding is a whole other beast.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (13)

fragmede 4 months ago | root | parent | prev | next [–]


Hm I thought I'd edited this. I was mistaken,

 ssh -o IdentitiesOnly=yes terminal.shop

works as expected, however I had an IdentityAgent set, and my key was being submitted via that route.

 ssh -o IdentitiesOnly=yes -o IdentityAgent=/dev/null terminal.shop

behaves as expected; same as

 ssh -a -i /dev/null -o IdentityAgent=/dev/null terminal.shop

Verified via whoami.filippo.io.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (14)

ProfessorZoom 4 months ago | root | parent | prev | next [–]


instructions not clear, my entire drive is empty now

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (15)

kazinator 4 months ago | parent | prev | next [–]


1. Why is this something that would be enabled by default.

2. Can't you disable agent forwarding in a config file, so as not to have to clutter the command line?

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (16)

hedora 4 months ago | root | parent | next [–]


I think it’s disabled by default on all distros I’ve used. You could add an entry to /etc/ssh_config or ~/.ssh/ if you want.

(It’ll still offer public keys by default in the exchange, but that’s “just” a privacy issue, not a privilege escalation problem.)

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (17)

Intralexical 4 months ago | parent | prev | next [–]


I just ran it in a `tmpfs` without any credentials:

 $ bwrap --dev-bind / / --tmpfs ~ ssh terminal.shop
One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (18)

jamesdutc 4 months ago | root | parent | next [–]


I think you may want to clear the environment (e.g., of `SSH_AUTH_SOCK`) as well as isolate in a PID namespace as well. I also reflexively `--as-pid-1 --die-with-parent`.

 bwrap --dev-bind / / --clearenv --tmpfs ~ --unshare-pid --as-pid-1 --die-with-parent ssh terminal.shop

(The `bwrap` manpage says “you are unlikely to use it directly from the commandline,” yet I use it like this all the time. If you do, too, then we should be friends!)

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (19)

Repulsion9513 4 months ago | parent | prev | next [–]


Honestly the only thing that you need is -a (and only if you made the bad choice to do agent forwarding by default). Sending your pubkey (and a signature, because the server pretends to accept your pubkey for some reason?) isn't a security risk and you're (in theory) going to be providing much more identifying information in the form of your CC...

(And as the siblings mentioned this won't work to prevent your key from being sent if you're using an agent)

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (20)

fragmede 4 months ago | root | parent | next [–]


I agree with you, but there are those that take an extreme stance on privacy and I'm willing to oblige.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (21)

SoftTalker 4 months ago | prev | next [–]


SSH Agent Forwarding does not happen by default. You need to include the -A option in your ssh command, unless maybe you've enabled it globally in your ~/.ssh/config file.

They can't get your private keys, but they could "perform operations on the keys that enable them to authenticate using the identities loaded into the agent" (quoting the man page). This would also only be possible while you are connected.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (22)

thih9 4 months ago | prev | next [–]


This is only a threat if you enable agent forwarding for all hosts.

If you enable agent forwarding for all hosts then yes, data will be forwarded.

Your link says:

> Don’t enable agent forwarding when connecting to untrustworthy hosts. Fortunately, the ~/.ssh/config syntax makes this fairly simple

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (23)

binkHN 4 months ago | parent | next [–]


Like you noted, ForwardAgent no is the default in /etc/ssh/ssh_config.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (24)

bananskalhalk 4 months ago | prev | next [–]


*disable ssh agent FORWARDING.

Which honestly should always be disabled. There are no trusted hosts.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (25)

tichiian 4 months ago | parent | next [–]


That's baby+bathwater.

Just use ssh-add -c to have the ssh-agent confirm every use of a key.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (26)

bananskalhalk 4 months ago | root | parent | next [–]


TIL. Thanks! Gonna do wonders when working at places where I can't use a hardware key with physical confirmation of use.

My assessment still stands. Use proxyjump (-J) instead of proxy command whenever possible.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (27)

tichiian 4 months ago | root | parent | next [–]


What can also help is specifying the right options right in ~/.ssh/config for certain hosts and domains: E.g. do "ForwardAgent no" globally, use a "Match *.my-trustworthy-company-domain.com" block and add "ForwardAgent yes" there.

Also very good for other options that are useful but problematic when used with untrustworthy target hosts, like ForwardX11, GSSAPIAuthentication, weaker *Algorithms (e.g. for those old Cisco boxes with no updates and similar crap).

Another neat trick is just using a ""Match *.my-trustworthy-company-domain.com" block" with an "IdentityFile ~/.ssh/secret-company-internal-key" directive. That key will then be used for those company-internal things, but not for any others, if you don't add it to the agent.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (28)

yjftsjthsd-h 4 months ago | root | parent | prev | next [–]


Whenever possible, yes, but AIUI it's not always possible; the one use case for which I believe full-on forwarding is required is using your personal credentials to transfer data between two remote servers (ex. rsync directly between servers). If there's a way to do that I would actually much appreciate somebody telling me, but I have looked and not found a way.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (29)

lrvick 4 months ago | root | parent | prev | next [–]


Or use a hardware backed ssh key you have to tap once for every use, like a Yubikey or Nitrokey.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (30)
One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (31)

deeblering4 4 months ago | root | parent | prev | next [10 more]


[flagged]

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (32)

tichiian 4 months ago | root | parent | next [–]


Sorry, English is not my native language. I know I sometimes sound strange because most of my use of the language is around the internet and at work, not that much casual "normal" conversation.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (33)

bee_rider 4 months ago | root | parent | next [–]


English is my native language and I have no idea what that person was talking about. Your post is fine.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (34)

hunter2_ 4 months ago | root | parent | next [–]


I think that person was talking about having had 4 out of 5 squares in a line on their bingo card already, and stumbling across "baby+bathwater" earned them bingo. The card is metaphorical though... more of a mental buffer that just overflowed.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (35)

bee_rider 4 months ago | root | parent | next [–]


That makes more sense than my solution.

As far as I’m concerned the baby and the bath water is just a normal expression.

I thought it was something about the use of “confirm,” haha.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (36)

hoistbypetard 4 months ago | root | parent | prev | next [–]


Mine too, and I think the post is fine also, but I have some idea of what that person was talking about. For a while, in some corporate environments, it was a recurring phenomenon to hear someone dismiss an urge to be cautious by saying "You're throwing out the baby with the bathwater."

So I can see where someone might count it toward buzzword bingo. But this post also offered an alternate solution when saying "baby+bathwater", so the bingo caller should refuse to score this one.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (37)

tomcam 4 months ago | root | parent | prev | next [–]


Your English is fine. That person was violating HN rules about snark (“Be kind. Don't be snarky. Converse curiously; don't cross-examine. Edit out swipes.”)

Learned that rule the hard way. It’s crucial to the success of HN and I am grateful dang corrected me.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (38)

deeblering4 4 months ago | root | parent | next [–]


I don't see a rule where joking is prohibited. People sure love their buzzwords though. Must bring them a feeling of synergy in these unprecedented times :)

Glad that at least a few people above got the joke

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (39)

tomcam 4 months ago | root | parent | next [–]


Did I mention joking?

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (40)

deeblering4 4 months ago | root | parent | next [–]


In your list of prohibited items? No. That's my point.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (41)

contingencies 4 months ago | parent | prev | next [–]


Default for the last 24 years according to https://github.com/openssh/openssh-portable/blame/385ecb31e1...

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (42)

sva_ 4 months ago | parent | prev | next [–]


I've found myself to be much more comfortable to just define all my private keys in ~/.ssh/config on a host-by-host basis.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (43)

jmole 4 months ago | root | parent | next [–]


AFAIK, this doesn't solve the SSH agent problem - the problem is the agent has access to all of those keys regardless of the host you connect to.

So forwarding your SSH agent means an administrator of the system you're connected to could use any of those host keys loaded in the agent to connect to their associated machine.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (44)

derefr 4 months ago | parent | prev | next [–]


> There are no trusted hosts.

...your own (headless) server that's in the same room as you, when you're using your laptop as a thin-client for it?

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (45)

dotancohen 4 months ago | root | parent | next [–]


Depending on what it's serving, and how up to date it is, and who else is on that network and can access the server, and who else can come into that same room when you're not there, and from where you get the software that you install on that server... it might be less trustworthy than you think.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (46)

jstanley 4 months ago | root | parent | next [–]


But if that's your standard then the laptop you're connecting from is not trusted either, and then you're not even allowed to use your own keys.

You're allowed to draw sensible boundaries.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (47)

xandrius 4 months ago | root | parent | prev | next [–]


With all these recent exploits, I wouldn't even be 100% sure of that.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (48)

wolletd 4 months ago | root | parent | next [–]


But if I can't trust even that host, I also can't trust the host I'm working on and which doesn't need agent forwarding to access my SSH agent.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (49)

hot_gril 4 months ago | root | parent | next [–]


Trusting one host is safer than trusting two hosts.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (50)

jethro_tell 4 months ago | root | parent | prev | next [–]


This is where certs are nice, sign one every morning with a 8/12 hour TTL

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (51)

quibuss 4 months ago | root | parent | next [–]


Interesting idea. Does need some automation though to make it practical irl.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (52)

arghwhat 4 months ago | prev | next [–]


Just to be clear, ssh agent forwarding is disabled by default and enabling it is always a hazard when connecting to machines that others also have access to.

Not at all specific to this.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (53)

nomel 4 months ago | prev | next [–]


Is it not standard practice to make different keys for different important services?

I have a private key for my prod server, a private key for GitHub, and a private junk key for authenticating to misc stuff. I can discard any without affecting anything else that's important.

If I authenticated with my junk key, would my other keys still be at risk?

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (54)

n2d4 4 months ago | parent | next [–]


> If I authenticated with my junk key, would my other keys still be at risk?

Yes, if you authenticate with your junk key (or no key), and SSH agent forwarding is enabled, you are still at risk. It lets the remote machine login to any server with any keys that are on your local SSH agent. Parent's link shows how this can be abused.

Fortunately, it's disabled by default, at least on newer versions.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (55)

leni536 4 months ago | parent | prev | next [–]


It's a good practice, but it's somewhat against the grain of ssh defaults. It's not surprising that many people stick to the defaults.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (56)

ShamelessC 4 months ago | parent | prev | next [–]


It’s a practice, but not necessarily a standard one. In any case if even one person sees that, the advice will have served its purpose.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (57)

brandensilva 4 months ago | root | parent | next [–]


TIL, the good news I guess is I only ssh into my hosting platforms and GitHub who have a reason to protect my data since I pay them.

Still I'll be sure to break up my keys more going forward and disable SSH forwarding.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (58)

semi 4 months ago | root | parent | next [–]


disabling agent forwarding is the important bit.

But if you do want to break up your keys more, make sure you specify IdentityFile and Identities Only in the per host definitions in your ssh config.

By default assuming you use an ssh agent (no forwarding) with multiple keys and a default ssh config, the behavior is to just try to auth with every key in order.

So if you're worried about the ssh server identifying you, you're still exposing yourself. I don't think this is much of a concern but worth noting.

Slightly more important: you're wasting time during the initial connection to fail authentication a few times. This can matter more with higher latency

Even more important: sshd has a configurable number of times a client is allowed to fail authentication in a session attempt. If you have too many other keys in your agent you will just fail to auth before it tries the key that is actually valid for that host.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (59)

Repulsion9513 4 months ago | parent | prev | next [–]


The only reason/benefit for using different keys is to prevent someone from correlating your identity across different services... if you're worried about that go ham

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (60)

hot_gril 4 months ago | parent | prev | next [–]


If anything it's more standard practice to have agent forwarding disabled, since that's the default.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (61)

jolmg 4 months ago | prev | next [–]


Default is disabled.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (62)

hnarn 4 months ago | parent | next [–]


Exactly, this tip only applies if you reconfigured ssh to automatically forward agent to all hosts, which is absolutely insane.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (63)

chuckadams 4 months ago | prev | next [–]


I take it you mean disable ssh agent forwarding — the agent itself is fine. You should never forward your ssh agent to a box you don’t trust as much as your own.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (64)

rvnx 4 months ago | parent | next [–]


Message edited, thank you, you are absolutely right.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (65)

chrismorgan 4 months ago | prev | next [–]


And for privacy, don’t let it know your identity or username:

 ssh -o PubkeyAuthentication=no -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -a [email protected]

Otherwise, the remote server can probably identify who you are on platforms like GitHub.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (66)

langcss 4 months ago | parent | next [–]


What I am reading from this there be dragons so don't use SSH to buy coffee!

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (67)

rmrf100 4 months ago | root | parent | next [–]


I think so.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (68)

kazinator 4 months ago | prev | next [–]


This feature is not enabled by default; "ForwardAgent = yes" has to be in the config file.

The article you cited makes it clear that you can turn this on for specific hosts in your private SSH config (and probably should do it that way).

So why wouldn't you?

Turning on forwarding globally and then having to remember to disable it for some untrusted hosts with -a looks silly and error-prone to me.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (69)

LeoPanthera 4 months ago | prev | next [–]


"ForwardAgent no" in ~/.ssh/config will do this automatically.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (70)

zaik 4 months ago | parent | next [–]


Not having "ForwardAgent yes" in ~/.ssh/config will do this automatically too.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (71)

hombre_fatal 4 months ago | root | parent | next [–]


Seems like a ridiculous amount of hoopla over something that isn't even a default.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (72)

teruakohatu 4 months ago | parent | prev | next [–]


Is "Host * \n AddKeysToAgent yes" acceptable from a security POV or should that also be per host?

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (73)

orblivion 4 months ago | parent | prev | next [–]


Is it "yes" by default? If so, that seems insane given what the op said about it. But other comments say it's "no" by default. If it's "no" by default, why are people alarming us by bringing this up? And why for terminal.shop in particular?

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (74)

zzo38computer 4 months ago | root | parent | next [–]


The man page for ssh_config(5) says that it is set to "no" by default, at least on my computer.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (75)

hot_gril 4 months ago | root | parent | prev | next [–]


Maybe there was some blanket advice in the past to enable it? Idk, this got me alarmed for nothing.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (76)

trallnag 4 months ago | root | parent | prev | next [–]


It's off by default. No idea what this fuzz is about. Gathering internet attention points maybe?

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (77)

heavyset_go 4 months ago | prev | next [–]


Using discoverable and non-discoverable keys via FIDO security keys will require PIN + physical confirmation, or just physical confirmation, by default if anyone tries to use your agent's keys.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (78)

lrvick 4 months ago | prev | next [–]


If you want to use SSH forwarding reasonably safely, use a yubikey for ssh so you have to tap once for each hop. Now a MITM can't use your key for more hops without you physically consenting to each one.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (79)

gowld 4 months ago | prev | next [–]


That's terrifying. I don't understand why the design requires Forwarding to work without more explicit consent from the client at use time. (That is, when the middle tier wants to make a connection, it should forward an encrypted challenge from the server that can only be decrypted, answered, and re-encrypted by the original ssh keyholder on the client, similar to how, you know, ssh itself works over untrusted routers.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (80)

acchow 4 months ago | parent | next [–]


AFAIK, that’s exactly how agent forwarding works. The explicit part is that you need to explicitly turn it on

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (81)

ZiiS 4 months ago | parent | prev | next [–]


It is not the default, you would have to have a silly config for this to matter.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (82)

mercora 4 months ago | prev | next [–]


You can configure the agent to confirm each key usage to have your cake and eat it too. :)

It's also good to see if any malicious process tries to make use of the agent locally!

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (83)

arcanemachiner 4 months ago | prev | next [–]


Thanks for the PSA. It gave me a good opportunity to double check that I hadn't enabled agent forwarding in any of my SSH scripts that don't need it.

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (84)

raggi 4 months ago | prev | next [–]


You actually want to verify first or someone will mitm you, e.g. mitm.terminal.shop.rag.pub

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (85)

dartos 4 months ago | prev | next [–]


With this one comment, you’ve convinced me that ssh apps are a bad idea

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (86)

vrighter 4 months ago | prev | next [–]


i usually just disable ssh agent forwarding globally by default, and only enable it selectively via my ~/.ssh/config

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (87)

abc_lisper 4 months ago | prev | next [–]


Dang. Didn't know this was a thing. Thank you!

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (88)

amne 4 months ago | prev [–]


here we go again. domain and path restricted cookies anyone?

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r... (2024)

FAQs

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the r...? ›

One safety tip: disable SSH Agent Forwarding before you connect, otherwise the remote server can theoretically reuse your private key to establish new connections to GitHub.com or prod servers (though this host is unlikely malicious). to connect. I'm curious why you added `-i /dev/null`.

Is SSH agent forwarding safe? ›

Never forward your SSH agent on a machine you do not trust. Although the private keys never leave your machine when using the SSH agent, the agent itself is forwarded to the jump server in a forwarding mode.

How to enable SSH agent forwarding? ›

Let's set up SSH to allow agent forwarding to your server.
  1. Using your favorite text editor, open up the file at ~/.ssh/config . ...
  2. Enter the following text into the file, replacing example.com with your server's domain name or IP: Host example.com ForwardAgent yes.

What is the alternative to forwarding SSH agent? ›

A better approach is to use the ProxyJump directive. Instead of forwarding the agent through a separate channel, ProxyJump forwards the standard input and output of your local SSH client through the bastion and on to the remote host.

What is SSH agent on mac? ›

ssh-agent is a background program that handles SSH private keys and their passphrases, making it easier to manage SSH-based authentication without entering your passphrase every time.

What is SSH forwarding? ›

Quick definition: SSH (Secure Socket Shell) port forwarding is a secure networking technique that allows data to be exchanged between two devices over an encrypted SSH connection. It enhances security and facilitates remote access by creating a protected channel for data transmission.

Can I disable SSH key agent? ›

Save khammami/0bf1598c0d72db91c3002e88811925f3 to your computer and use it in GitHub Desktop. This will disable the SSH agent, remove your SSH keys from the agent, and configure Git to use SSH authentication, ensuring that Git prompts you for your SSH passphrase each time you push.

How to know if a ssh-agent is running? ›

Running ssh-add -l will display all keys currently known to your agent. If the list is empty, you have an ssh-agent running, but no keys currently unlocked.

What is the flag for SSH key forwarding? ›

An OpenSSH user can forward their Key Agent to the remote machine using the -A flag on the ssh command line. This allows the user to use arbitrary keys stored on their local machine to authenticate against a "Third Machine" from inside their session on the Remote Machine.

How to enable ssh-agent service? ›

How to Use ssh-agent
  1. Use the following command to execute the ssh-agent commands and enable ssh-agent for your current shell session: eval `ssh-agent` Note. ...
  2. Verify that ssh-agent is running by checking for the SSH_AUTH_SOCK environmental variable: echo $SSH_AUTH_SOCK. /tmp/ssh-qmq8m7V80sRi/agent.42596.
Nov 10, 2022

Is port forwarding safe for SSH? ›

SSH port forwarding is generally considered secure as it encrypts traffic passing through the SSH tunnel, providing a secure channel for data transmission between the client and the SSH server.

How do you stop an ssh-agent? ›

SSH agents you invoke yourself don't die automatically when you log out: you must kill them explicitly. When you run an agent, it defines the environment variable SSH_AGENT_PID . [Recipe 6.9] Simply test for its existence and kill the agent with the -k option.

Why use ssh-agent? ›

The ssh-agent is a helper program that keeps track of users' identity keys and their passphrases. The agent can then use the keys to log into other servers without having the user type in a password or passphrase again.

How do I disable SSH on my Mac? ›

To disable SSH, simply turn off Remote Login in the Sharing pane in System Settings/Preferences. In macOS Ventura and later, the Sharing pane is found in the General section. In previous versions of macOS, Sharing is found in one of the rows displayed when System Preferences is first opened.

Is SSH enabled on my Mac? ›

Pull down the  Apple menu and go to “System Preferences” Open the “Sharing” preference panel” Check the box for “Remote Login” to turn on the SSH server on the Mac. Optionally but recommended for anyone wanting to create a full shell experience, check the box for “Allow full disk access for remote users”

How to check if SSH is installed on Mac? ›

To check if OpenSSH is installed, open a terminal and run:
  1. 1 ssh -V. The output should show the installed version of OpenSSH. ...
  2. 1 brew install openssh. To check that OpenSSH was installed successfully, run:
  3. 1 ssh -V. The output should show the installed version of OpenSSH.

Is port forwarding SSH Secure? ›

SSH port forwarding is generally considered secure as it encrypts traffic passing through the SSH tunnel, providing a secure channel for data transmission between the client and the SSH server.

Is SSH actually secure? ›

SSH is "secure" because it incorporates encryption and authentication via a process called public key cryptography. Public key cryptography is a way to encrypt data, or sign data, with two different keys. One of the keys, the public key, is available for anyone to use.

Is exposing SSH port safe? ›

In the context of Secure Shell (SSH), port forwarding port 22 is generally not considered a secure practice. Port 22 is the default port for SSH, and as such, it is a common target for malicious actors attempting to gain unauthorized access to your systems.

Can SSH client be hacked? ›

An attacker can exploit unpatched vulnerabilities in SSH implementations by utilizing various techniques to gain unauthorized access or compromise the security of the system.

Top Articles
The Most Important Elements of Short-Term Financial Management
Financial Literacy Resources
Ron Martin Realty Cam
Lengua With A Tilde Crossword
Tmf Saul's Investing Discussions
Lexi Vonn
1970 Chevrolet Chevelle SS - Skyway Classics
Algebra Calculator Mathway
Top Scorers Transfermarkt
Crocodile Tears - Quest
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Owatc Canvas
Jesse Mckinzie Auctioneer
Ou Class Nav
Crusader Kings 3 Workshop
MindWare : Customer Reviews : Hocus Pocus Magic Show Kit
Clarksburg Wv Craigslist Personals
Tcu Jaggaer
My.tcctrack
Craftology East Peoria Il
Dignity Nfuse
Q Management Inc
623-250-6295
Vigoro Mulch Safe For Dogs
Danforth's Port Jefferson
Evil Dead Rise Showtimes Near Pelican Cinemas
12 Facts About John J. McCloy: The 20th Century’s Most Powerful American?
1 Filmy4Wap In
Kitchen Exhaust Cleaning Companies Clearwater
Nearest Ups Ground Drop Off
Does Royal Honey Work For Erectile Dysfunction - SCOBES-AR
What does wym mean?
Tra.mypatients Folio
Truis Bank Near Me
Powerball lottery winning numbers for Saturday, September 7. $112 million jackpot
Bimmerpost version for Porsche forum?
1v1.LOL Game [Unblocked] | Play Online
The All-New MyUMobile App - Support | U Mobile
Clima De 10 Días Para 60120
Hazel Moore Boobpedia
Three V Plymouth
Chathuram Movie Download
VPN Free - Betternet Unlimited VPN Proxy - Chrome Web Store
Collision Masters Fairbanks
Candise Yang Acupuncture
Accident On 40 East Today
Brutus Bites Back Answer Key
Craigslist Sarasota Free Stuff
Elvis Costello announces King Of America & Other Realms
Deshuesadero El Pulpo
The Ultimate Guide To 5 Movierulz. Com: Exploring The World Of Online Movies
Latest Posts
Article information

Author: Domingo Moore

Last Updated:

Views: 6319

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Domingo Moore

Birthday: 1997-05-20

Address: 6485 Kohler Route, Antonioton, VT 77375-0299

Phone: +3213869077934

Job: Sales Analyst

Hobby: Kayaking, Roller skating, Cabaret, Rugby, Homebrewing, Creative writing, amateur radio

Introduction: My name is Domingo Moore, I am a attractive, gorgeous, funny, jolly, spotless, nice, fantastic person who loves writing and wants to share my knowledge and understanding with you.