【问题描述】:
期待需要使用私钥通过java代码连接aws服务器
在服务器端实现Redhat 8之前,我能够成功登录。如果我禁用 FIS(Fuse 集成服务),然后按预期工作。我尝试了很多方法,没有运气。请帮助解决这个问题如果需要更多信息,请告诉我
在java代码中使用intellij
私钥格式为 RSA 3,我已使用 PuttyGen 转换为 RSA 2
键模式是
PuTTY-User-Key-File-2: ssh-rsa
Encryption:none
Comment: rsa-key-20220125
Public-Lines:12
![图片[1]-java代码中使用intellij私钥格式为RSA3键模式-唐朝资源网](https://images.43s.cn/wp-content/uploads//2022/07/1657468203117_0.png)
AAAn23vnonBIhk......................
..................
....................................
Private-Lines:28
AACABdkfjal905 slknf................
....................................
Private-MAC: nbfajesrkkjnajfnga;alksdnfal;dks
Java 代码是
————
JSch jsch = new JSch();
jsch.addIdentity(privatekey)
Session session = jsch.getSession(username, hostname, port);
session.setConfig ("StrickHostKeyChecking","no")
session.connect();
————-
我总是遇到错误
%————%
com.jcraft.jsch.JSchException : Auth Fail
at com.jcraft.jsch.Session.connect(Session.java:519)
at com.jcraft.jsch.Session.connect(Session.java:183)
%————%
从服务器端记录#
通过使用linux命令“systemctl status sshd.service
rexec line 29: Deprecated option KeyRegenerationInterval
rexec line 30: Deprecated option ServerKeyBits
rexec line 66: Deprecated option RSAAuthentication
rexec line 82: Deprecated option RhostsRSAAuthentication
reprocess config line 66 : Deprecated option RSAAuthentication
reprocess config line 82 : Deprecated option RhostsRSAAuthentication
error: Receivved disconnect from port :3 com.jcrat.jsch.JSchException:Auth fail [preauth]
Disconnected from authenticating user ec2-user port [preauth]
当我尝试通过 Putty 0.76 成功登录时,请在下面找到 train -f 消息当我尝试通过 PuTTY 成功登录时的 Service Tail 消息
Reached Target Timers
Reached target Paths
Listening on D-Bus User Message Bus Socket
Reached target Sockets
Reached target Basic System
Reached target default
Startup finished in 324ms
Started User Manager for UID 1000
【问题讨论】:
© 版权声明
本站下载的源码均来自公开网络收集转发二次开发而来,
若侵犯了您的合法权益,请来信通知我们1413333033@qq.com,
我们会及时删除,给您带来的不便,我们深表歉意。
下载用户仅供学习交流,若使用商业用途,请购买正版授权,否则产生的一切后果将由下载用户自行承担,访问及下载者下载默认同意本站声明的免责申明,请合理使用切勿商用。
THE END
暂无评论内容