Comments (5)
Which functions do you need to expose? Focusing on tssh as a program may help me reconstruct it in the future.
from trzsz-ssh.
First of all type SshArgs
from trzsz-ssh.
Next secretEncodeKey as SecretEncodeKey.
And I suggest modify getPasswordAuthMethod to
func getPasswordAuthMethod(args *SshArgs, host, user string) ssh.AuthMethod {
if strings.ToLower(getOptionConfig(args, "PasswordAuthentication")) == "no" {
debug("disable auth method: password authentication")
return nil
}
idx := 0
rememberPassword := false
return ssh.RetryableAuthMethod(ssh.PasswordCallback(func() (string, error) {
idx++
if idx == 1 {
password := args.Option.get("Password")
if password == "" {
password = getSecretConfig(args.Destination, "Password")
} else {
encoded, err := encodeSecret([]byte(password))
if err == nil {
warning("insert next line\r\nIgnoreUnknown *\r\nto the beginning of the file [~/.ssh/config] and append after [Host %s] next line\r\n encPassword %s", args.Destination, encoded)
}
}
if password != "" {
rememberPassword = true
debug("trying the password configuration for '%s'", args.Destination)
return password, nil
}
} else if idx == 2 && rememberPassword {
warning("the password configuration for '%s' is incorrect", args.Destination)
}
secret, err := readSecret(fmt.Sprintf("%s@%s's password: ", user, host))
if err != nil {
return "", err
}
return string(secret), nil
}), 3)
}
from trzsz-ssh.
Related Issues (20)
- ~/.ssh/config 中配置的 SetEnv TERM 无效 HOT 2
- 能否支持登录之后切换用户呢? HOT 1
- 能否做一个忽略的功能呢?ssh中存在很多其实并不需要真的连接的配置。 HOT 6
- tssh无法用key连接,ssh正常,请问是哪里没正确吗? HOT 55
- [功能请求] 通过命令行参数传递密码 HOT 2
- 无法解析 ssh/confg 中多项 Include HOT 6
- 可以美化文件传输的进度条吗? HOT 6
- 引入兼容 Warp 的软链接后,影响了 rsync 的运行 HOT 3
- 按照免密登录配置后,ssh 登录可以免密,但是 tssh 提示请出入密码。 HOT 1
- [selfupdate] could u kindly consider add selfupdate
- mintty Ctrl-C退出整个tssh HOT 12
- -R for serveo.net or ssh-j.com on Windows10 and Debian12 HOT 19
- My user name include a symbol '#' that i can't login destination host HOT 2
- 无法激活1password的ssh agent HOT 5
- Mosh 支持 HOT 25
- 类似于xftp实现跨服务器传输文件 HOT 3
- tssh执行后面直接执行命令报错 HOT 2
- 拖曳上传现在只支持trzsz, 能否支持lrzsz的拖曳上传? HOT 2
- 在 warp 中 block 功能不生效 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trzsz-ssh.