I have several SSH configurations in the file ~/.ssh/config on my local Linux machine.

Is it possible to assign a new flag to an existing binary like /usr/bin/ssh such that I can execute ssh -l to get a list of available connections (for example)?

I know that I can cat ~/.ssh/config (or similar), but I'm wondering specifically whether it's possible to add or alias a flag on a system binary.


Not intrinsically, no – there are, however some workarounds, including –

  1. Get the source code, modify it, recompile, and use your own version of the software.

  2. Create a wrapper (which could be a script or a shell function) that looks what it gets on the command line and passes options through and/or handles additional functionality.

These typically involve renaming the program, or ensuring that your version occurs earlier in your search path than the original.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.