-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tssh无法用key连接,ssh正常,请问是哪里没正确吗? #103
Comments
|
谢谢抽空回复。 不管我贴私钥还是公钥,都不行。。。但是用ssh都可以正常连接,就很奇怪。。。 ➜ ~ cat ~/.ssh/config Host Jumpserver ➜ ~ tssh -p2222 -i ~/.ssh/id_rsa xxx@xxx |
|
➜ ~ tssh -V 我是mac,通过brew安装的。 |
奇怪了,你加多一行配置试试:
|
一样的情况。。。 |
这样登录试试。 |
另外,你在命令行中用的是 你现在的配置是 |
tssh -p2222 -i /Users/xxx/.ssh/id_rsa -o PasswordAuthentication=no [email protected] 是不是ssh-rsa不支持?
我用过tssh Jumpserver也不行呢,所以我才换tssh -p [email protected]这些来测试,想看看输出内容 |
试试这样 |
➜ ~ tssh -p2222 -i ~/.ssh/id_rsa -o KbdInteractiveAuthentication=yes [email protected] 还是提示我输密码。。。 |
|
已发送~麻烦你了。 |
你试试 你发送的日志,我选出重要的一些:
看来是先 PubkeyAuthentication,部分成功后,再走到 KbdInteractiveAuthentication 的。 现在 |
➜ ~ ssh -o PubkeyAuthentication=no -p2222 加上以后让我输密码了 |
你的服务器果然是 PubkeyAuthentication + KbdInteractiveAuthentication 这种认证方式,tssh 暂时是不支持的。 |
估计服务端ubuntu的ssh开启了这两种认证。。。好的吧,期待支持。。。感谢解答 |
在支持之前,你可以这样配置,
如果你能通过命令获取到 otp code,或者知道 totp 的密钥,还可以配置自动交互。
又如( 这个是通过命令
|
感谢热情回复。 Host xxx btw: |
ControlPath 是不是配错了?不应该是 /Users/xxx/.ssh/id_rsa 。你再加一次前缀或后缀吧,不要与其他文件的路径重复了。 |
没用过controlpath,我以为要改成真实路径,我现在照抄你的替换回来了~ Host Jumpserver 输出如下: 还是不太行,T-T |
你执行 |
输出如下 |
执行 |
No PTY requested. |
如果把 |
一样,是No PTY requested. |
你这服务器有些特殊,不支持没有 pty 的用法。 你可以再加一个 |
我明天到公司了再测试一下,我也忘了什么版本的系统了,可能是ubuntu,也可能是阿里基于centos修改的ali os。。。 |
查了下,是阿里自己改的系统,Alibaba Cloud Linux release 3 (Soaring Falcon) 估计瞎定制了一堆东西
|
应该跟操作系统无关,与 2222 端口对应的进程有关。这个端口应该是对应你说的开源跳板机吧?可能它的默认配置就是这样的,同时要求 PubkeyAuthentication + KbdInteractiveAuthentication 两种认证,并且禁止了无 pty 的模式(一般的 ssh 服务器都是默认允许无 pty 的)。 |
就国产开源的那款jumpserver呗~去年还在他们那看到你提的feature问他们是否考虑接入trzsz呢,我就是那边看到你的 |
我安装来玩过,后面有空了再研究一下你遇到的这两个问题。应该不是你上面这个图这里,估计是你配置 otp 那里。 |
好的,就是厌烦了每次输入otp,想一劳永逸,还是没解决= = |
@fengmikaelson 那个跳板机的 otp 是在哪里配置的?或者发一下配置的文档。 |
文档好像就这一些内容 |
你自己编译一个来试试( 更新 golang.org/x/crypto 到 v0.22.0 )?步骤:
|
我不确定是不是可以了,我尝试断网了,它也正常跳过otp让我进入了。 我删了#!!这些也跳过otp 了= = |
这些配置应该全都不需要。 |
Host Jumpserver 不行~喊我输密码了,但是可以直接为空跳过,到otp阶段 |
你再加 |
new conn [xxx.com:2222] failed: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain |
是用这个重新编译的?要执行
|
事的 |
go.mod 文件中 |
是的 |
我看 golang/go#17889 这个 issue 前几天 close 了,可能只是支持 server side:golang/go#61447 |
非自己编译那个 v0.1.19 是不能到 otp 阶段的? |
是的,0.1.19也是这个错误 new conn [xxx.com:2222] failed: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain 换./bin/tssh也是 |
能到 otp 阶段,应该就好办了。你去掉 |
我发你邮箱了,不然要剔除好多私密信息= = |
这样应该就能自动登录了。上面的 |
Host Jumpserver 目前用这个配置,可以了。 |
|
不是,哈哈,随便xxx了几个 |
请教一下~
用ssh可以正常识别登录,并跳转到otp
换tssh就一直失败
Host Jumpserver
HostName xxx.com
Port 2222
User xxx
#!!IdentityFile /Users/xxx/.ssh/id_rsa.pub
➜ ~ ssh -p2222 -i .ssh/id_rsa.pub [email protected]
xxx
Please Enter MFA Code.
([email protected]) [OTP Code]: ^C
➜ ~ tssh -p2222 -i .ssh/id_rsa.pub [email protected] --debug
debug: /Users/xxx/.tssh.conf does not exist
debug: open config [/Users/xxx/.ssh/config] success
debug: decode config [/Users/xxx/.ssh/config] success
debug: open config [/etc/ssh/ssh_config] success
debug: decode config [/etc/ssh/ssh_config] success
debug: new ssh agent client [/private/tmp/com.apple.launchd.SMeXPhhmdg/Listeners] success
Warning: parse private key [.ssh/id_rsa.pub] failed: ssh: no key found
debug: add auth method: keyboard interactive authentication
debug: add auth method: password authentication
debug: add UserKnownHostsFile: /Users/xxx/.ssh/known_hosts
debug: UserKnownHostsFile [/Users/xxx/.ssh/known_hosts2] does not exist
debug: GlobalKnownHostsFile [/etc/ssh/ssh_known_hosts] does not exist
debug: GlobalKnownHostsFile [/etc/ssh/ssh_known_hosts2] does not exist
debug: user declared ciphers: [[email protected] aes128-ctr aes192-ctr aes256-ctr [email protected] [email protected] aes128-cbc aes192-cbc aes256-cbc]
debug: client supported ciphers: [[email protected] aes128-ctr aes192-ctr aes256-ctr [email protected] [email protected] aes128-cbc]
debug: login to [xxx.com], addr: xxx.com:2222
debug: extended config [/Users/xxx/.ssh/password] does not exist
debug: no extended config [encPassword] for [xxx.com]
debug: no extended config [Password] for [xxx.com]
[email protected]'s password:
不知道哪里出问题了,所以来请教一下。
The text was updated successfully, but these errors were encountered: