trzsz / trzsz-ssh

trzsz-ssh ( tssh ) is an ssh client designed as a drop-in replacement for the openssh client. It aims to provide complete compatibility with openssh, mirroring all its features, while also offering additional useful features. Such as login prompt, batch login, remember password, automated interaction, trzsz, zmodem(rz/sz), udp mode like mosh, etc.
https://trzsz.github.io/ssh
MIT License
1.74k stars 102 forks source link

[suggestion] is it possible to add feature of provider api #94

Closed warjiang closed 2 months ago

warjiang commented 8 months ago

provider api means that not only we can get host from location ssh config file, but also from a rest api, the rest api should have some restriction, like data restriction.

lonnywong commented 8 months ago

It is technically possible, but there may be some security risks. It will be more complicated, and the requirements for users will be very high.

warjiang commented 8 months ago

or may a plugin of trzsa-ssh.

It is technically possible, but there may be some security risks. It will be more complicated, and the requirements for users will be very high.

indeed. tssh provide a open-box options for most of users. If supported this feature, for advanced user, we can provide spec to let them to implemented, for common user, we can provide a subproject in form of docker to reduce the complexity of provide api.

It is technically possible, but there may be some security risks.

cannot agree with this point any more, so we need to have a full consideration.

lonnywong commented 8 months ago

Is it possible for users to implement a client themselves, write a custom configuration file after obtaining the informations, and then specify the default configuration file in ~/.tssh.conf?

warjiang commented 8 months ago

sounds feasible 👍

lonnywong commented 4 months ago

Now you can get the host information from anywhere you want, convert it into ssh command line arguments, and call tssh to log in.

Before v0.1.22 is released, you can go get github.com/trzsz/trzsz-ssh@main, and then call tssh to log in like:

package main

import (
    "os"
    "github.com/trzsz/trzsz-ssh/tssh"
)

func main() {
    code := tssh.TsshMain([]string{"-t", "root@192.168.0.1"})
    os.Exit(code)
}