sohutv / cachecloud

搜狐视频(sohu tv)Redis私有云平台 :支持Redis多种架构(Standalone、Sentinel、Cluster)高效管理、有效降低大规模redis运维成本,提升资源管控能力和利用率。平台提供快速搭建/迁移,运维管理,弹性伸缩,统计监控,客户端整合接入等功能。(CacheCloud is a Redis cloud management platform. It supports Standalone, Sentinel, and Cluster architectures for Redis, effectively reducing large-scale Redis operation and maintenance costs, and improving resource management and utilization. The platform provides rapid construction/migration, operation and maintenance management, elastic scaling, statistical monitoring, client integration and access and other functions)
http://cachecloud.github.io/
Apache License 2.0
8.76k stars 2.04k forks source link

日志提示 java.io.FileNotFoundException: /opt/ssh/id_rsa (Permission denied) 错误,但通过 ssh 手动能登陆上 #299

Closed slowtech closed 1 year ago

slowtech commented 1 year ago

您好,

日志提示 java.io.FileNotFoundException: /opt/ssh/id_rsa (Permission denied) 错误,但是手动通过 ssh 可以登陆。

日志中错误信息如下:

`2023-02-09 10:25:01.020 ERROR 2335 --- [-pool-thread-39] com.sohu.cache.ssh.SSHTemplate : getConnection 10.0.0.10:22 error message is /opt/ssh/id_rsa (Permission denied)

java.io.FileNotFoundException: /opt/ssh/id_rsa (Permission denied) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.(FileInputStream.java:138) at java.io.FileReader.(FileReader.java:72) at ch.ethz.ssh2.Connection.authenticateWithPublicKey(Connection.java:416) at com.sohu.cache.ssh.SSHTemplate$1.execute(SSHTemplate.java:107) at com.sohu.cache.util.IdempotentConfirmer.run(IdempotentConfirmer.java:27) at com.sohu.cache.ssh.SSHTemplate.getConnection(SSHTemplate.java:122) at com.sohu.cache.ssh.SSHTemplate.execute(SSHTemplate.java:50) at com.sohu.cache.ssh.SSHUtil.getMachineInfo(SSHUtil.java:73) at com.sohu.cache.machine.impl.MachineCenterImpl.collectMachineInfo(MachineCenterImpl.java:144) at com.sohu.cache.machine.impl.MachineCenterImpl$1.execute(MachineCenterImpl.java:118) at com.sohu.cache.machine.impl.MachineCenterImpl$1.execute(MachineCenterImpl.java:115) at com.sohu.cache.async.KeyCallable.call(KeyCallable.java:22) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750)

2023-02-09 10:25:01.020 WARN 2335 --- [-pool-thread-39] com.sohu.cache.ssh.SSHTemplate : connect 10.0.0.10:22 timeOutFactor is 2 2023-02-09 10:25:01.020 ERROR 2335 --- [-pool-thread-39] com.sohu.cache.ssh.SSHTemplate : getConnection 10.0.0.10:22 error message is Connection to 10.0.0.10 is already in connected state!

java.io.IOException: Connection to 10.0.0.10 is already in connected state! at ch.ethz.ssh2.Connection.connect(Connection.java:585) at com.sohu.cache.ssh.SSHTemplate$1.execute(SSHTemplate.java:102) at com.sohu.cache.util.IdempotentConfirmer.run(IdempotentConfirmer.java:27) at com.sohu.cache.ssh.SSHTemplate.getConnection(SSHTemplate.java:122) at com.sohu.cache.ssh.SSHTemplate.execute(SSHTemplate.java:50) at com.sohu.cache.ssh.SSHUtil.getMachineInfo(SSHUtil.java:73) at com.sohu.cache.machine.impl.MachineCenterImpl.collectMachineInfo(MachineCenterImpl.java:144) at com.sohu.cache.machine.impl.MachineCenterImpl$1.execute(MachineCenterImpl.java:118) at com.sohu.cache.machine.impl.MachineCenterImpl$1.execute(MachineCenterImpl.java:115) at com.sohu.cache.async.KeyCallable.call(KeyCallable.java:22) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750)`

通过 ssh 能手动登陆上 [cachecloud-open@cachecloud ~]$ ssh -i /opt/ssh/id_rsa cachecloud-open@10.0.0.10 [cachecloud-open@node1 ~]$

/opt/ssh/id_rsa 文件的权限如下: [root@cachecloud targ]# ll /opt/ssh/ -d drwx------. 2 cachecloud-open cachecloud-open 38 Feb 9 09:38 /opt/ssh/ [root@cachecloud targ]# ll /opt/ssh/id_rsa -rwx------. 1 cachecloud-open cachecloud-open 1675 Feb 9 09:38 /opt/ssh/id_rsa

githubname1024 commented 1 year ago

请排查文件权限是否配置正确,是否给cachecloud系统的用户配置正确的文件读写等权限。