frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Why is there no native SSH hook to run a local command before connecting

6•tetris11•2d ago
The `LocalCommand` parameter only runs a command on the local machine after the connection is established.

Is there no pre-connection hook?

My use case is simply that I do port knocking to expose my ssh port, and want this working automatically at the SSH config level so that I can use it transparently from other utilities (e.g. Ansible inventory, Emacs over TRAMP)

Comments

Bender•2d ago
This [1] is one way.

[1] - https://unix.stackexchange.com/questions/44307/can-ssh-confi...

ranger_danger•4h ago
Besides the ProxyCommand approach, another way would be to define 'ssh' as a shell alias/function that does the port knocking first and then passes any parameters to the normal /usr/bin/ssh.

Or you could make your own 'ssh' shell script somewhere else on the filesystem that handles it for you.

dylan604•3h ago
without making it an alias, would this shell script somewhere else be usable by the other applications from the question? if you can provide the specific path rather than the system looking for whatever ssh was installed, then maybe, but i don't know those specifics which makes using the shell script have question marks.
waqasx•3h ago
You can write a script and put it in PATH
ranger_danger•3h ago
You could either put the script somewhere earlier within the PATH than wherever the normal ssh binary is, or manually export a new PATH with some other custom folder that comes first, which you could use to override anything, e.g. export PATH=/root/bin:$PATH
capitainenemo•3h ago
Can't you use Match exec?
bityard•3h ago
OpenSSH was written by and is still maintained by those who adhere to The Unix Way. If you asked for this feature, they would probably tell you to just use a shell alias or function instead.

iPhone Air

https://www.apple.com/newsroom/2025/09/introducing-iphone-air-a-powerful-new-iphone-with-a-breakt...
552•excerionsforte•9h ago•1192 comments

Things you can do with a debugger but not with print debugging

https://mahesh-hegde.github.io/posts/what_debugger_can/
44•never_inline•2d ago•22 comments

E-paper display reaches the realm of LCD screens

https://spectrum.ieee.org/e-paper-display-modos
275•rbanffy•9h ago•90 comments

Outraged Farmers Blame Ag Monopolies as Catastrophic Collapse Looms

https://www.agweb.com/markets/outraged-farmers-blame-ag-monopolies-catastrophic-collapse-looms
118•strict9•2h ago•117 comments

Claude now has access to a server-side container environment

https://www.anthropic.com/news/create-files
451•meetpateltech•12h ago•258 comments

Axial twist theory

https://en.wikipedia.org/wiki/Axial_twist_theory
80•lordnacho•3d ago•14 comments

We all dodged a bullet

https://xeiaso.net/notes/2025/we-dodged-a-bullet/
584•WhyNotHugo•12h ago•336 comments

US High school students' scores fall in reading and math

https://apnews.com/article/naep-reading-math-scores-12th-grade-c18d6e3fbc125f12948cc70cb85a520a
261•bikenaga•12h ago•373 comments

Memory Integrity Enforcement

https://security.apple.com/blog/memory-integrity-enforcement/
331•circuit•8h ago•153 comments

Immunotherapy drug clinical trial results: half of tumors shrink or disappear

https://www.rockefeller.edu/news/38120-immunotherapy-drug-eliminates-aggressive-cancers-in-clinic...
290•marc__1•6h ago•60 comments

Tomorrow's emoji today: Unicode 17.0

https://jenniferdaniel.substack.com/p/tomorrows-emoji-today-unicode-170
113•ChrisArchitect•9h ago•159 comments

DuckDB NPM packages 1.3.3 and 1.29.2 compromised with malware

https://github.com/duckdb/duckdb-node/security/advisories/GHSA-w62p-hx95-gf2c
323•tosh•17h ago•242 comments

YouTube is a mysterious monopoly

https://anderegg.ca/2025/09/08/youtube-is-a-mysterious-monopoly
145•geerlingguy•22h ago•203 comments

A new experimental Go API for JSON

https://go.dev/blog/jsonv2-exp
181•darccio•12h ago•60 comments

Hypervisor in 1k Lines

https://1000hv.seiya.me/en
24•lioeters•4h ago•2 comments

Show HN: Bottlefire – Build single-executable microVMs from Docker images

https://bottlefire.dev/
56•losfair•2d ago•8 comments

Building a DOOM-like multiplayer shooter in pure SQL

https://cedardb.com/blog/doomql/
150•lvogel•12h ago•31 comments

Microsoft is officially sending employees back to the office

https://www.businessinsider.com/microsoft-send-employees-back-to-office-rto-remote-work-2025-9
250•alloyed•10h ago•450 comments

She puts the Lord in 'vanlord.' Palo Alto wants to ban her business

https://sanjosespotlight.com/she-puts-the-lord-in-vanlord-palo-alto-wants-to-ban-her-business/
5•harambae•2d ago•1 comments

An attacker’s blunder gave us a look into their operations

https://www.huntress.com/blog/rare-look-inside-attacker-operation
130•mellosouls•11h ago•82 comments

Anthropic judge rejects $1.5B AI copyright settlement

https://news.bloomberglaw.com/ip-law/anthropic-judge-blasts-copyright-pact-as-nowhere-close-to-done
192•nobody9999•18h ago•209 comments

Show HN: Ion, a Rust/Tokio powered JavaScript runtime for embedders

https://github.com/alshdavid/ion
20•apatheticonion•2d ago•1 comments

ICE is using fake cell towers to spy on people's phones

https://www.forbes.com/sites/the-wiretap/2025/09/09/how-ice-is-using-fake-cell-towers-to-spy-on-p...
497•coloneltcb•10h ago•204 comments

Go for Bash Programmers – Part II: CLI Tools

https://github.com/go-monk/from-bash-to-go-part-ii
91•reisinge•1d ago•3 comments

Dropbox Paper mobile App Discontinuation

https://help.dropbox.com/installs/paper-mobile-discontinuation
123•mercenario•9h ago•105 comments

A cryptography expert on how Web3 started, and how it’s going

https://spectrum.ieee.org/web3-hardware-security
144•warrenm•8h ago•161 comments

Weave (YC W25) is hiring a founding AI engineer

https://www.ycombinator.com/companies/weave-3/jobs/SqFnIFE-founding-ai-engineer
1•adchurch•10h ago

NASA finds Titan's alien lakes may be creating primitive cells

https://www.sciencedaily.com/releases/2025/08/250831112449.htm
44•Gaishan•3h ago•2 comments

Cassette Logic: technology that never dies but is already dead

https://www.differentshelf.com/cassette-logic/
9•seductivebarry•2d ago•8 comments

Mistral raises 1.7B€, partners with ASML

https://mistral.ai/news/mistral-ai-raises-1-7-b-to-accelerate-technological-progress-with-ai
726•TechTechTech•21h ago•385 comments