Git Product home page Git Product logo

Comments (5)

Asher256 avatar Asher256 commented on August 25, 2024

I agree. Rewriting an SSH config parser doesn't make sense ;) . It would be a waste of time IMHO. If you really need to parse it you can use some Python "paramiko" functions.

The solution you provided is interesting ([email protected] in ~/.apssh/desktops), however it is not enough to replace the ~/.ssh/config, because in ~/.ssh/config you can define different private keys for a group of hosts, ProxyCommand (useful for trusted hosts) and many other useful SSH options.

What kind of library / backend do you use for apssh to run SSH commands? Do you use the SSH command or a library like libssh/paramiko? Can we add a custom options to ssh like -F for example with apssh?

from apssh.

parmentelat avatar parmentelat commented on August 25, 2024

apssh is entirely based on asyncssh, and on asyncio more generally
For this reason I didn't know much about paramiko, but at first - and quick - sight it looks like this library can be easily leveraged for parsing a config file in an ssh format

this indeed opens up a lot of possibilities - too many maybe :-) so I need to prioritize here.

In a first pass I suggest to add the following minimal features:
. look into ~/.apssh (or something else if specified with -D) to locate target files, as I mentioned above
. opening the ssh config when found (or something else specified with -F), and using this for a handful of supported configuration options. This of course will necessarily be a small subset of what ssh supports. I understand you'd like to see at least the following tags to be used

  • Hostname
  • User

You seem to suggest there is an ssh config option to specify private keys on a host-per-host basis, but I could not spot this one; in any case please suggest other ssh config options that could be added to this batch.

If we go down this road, there is the question of the interdependance of these two config schemes.
In the case where a name is found both in ~/.apssh and in the ssh config file, my proposal is for the .apssh source to take precedence.

Also both schemes could be turned off by specifying either -F /dev/null or -D /dev/null

How would that sound ?

from apssh.

parmentelat avatar parmentelat commented on August 25, 2024

For now in version 0.2.8 I have added the search in ~/.apssh (not overridable with -D btw at this point)
As soon as you send your feedback, and esp. about locating keys on a node-per-node basis, I can go on with this feature

from apssh.

parmentelat avatar parmentelat commented on August 25, 2024

Let me add that I'd really like to try and leverage the ProxyCommand defined in ssh's config as well

apssh supports 2-hops connections through a gateway, and clearly most of the time this data is captured in such ProxyCommand's
Of course I far as I can tell this would be heuristics of some kind, as the ProxyCommand itself can be anything..

Comments/thoughts/hints are more than welcome

from apssh.

parmentelat avatar parmentelat commented on August 25, 2024

The ability to have groups has been around for a while already

I am keeping this open as a hint to use another library - paramiko ? - to read the contents of the ssh config and try to leverage that as much as possible

from apssh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.