GitHub提示 Error: Key already in use解决办法

本文介绍如何解决因旧账户密钥导致的新GitHub账户SSH密钥添加失败的问题。通过命令行工具定位并删除占用的密钥,确保新账户的正常配置。

出现这个的原因是你在以前也用过GitHub,并且提交了你的密钥,这个时候你可以通过在命令行里输入ssh -T -i ~/.ssh/id_rsa git@github.com来查看到底是哪一个账户在使用此密钥,会出现如下提示

其中saymagic的位置就是所占用的用户名,你需要前去登录此账户,将其对应的delete掉,相信你知道怎么添加,也一定知道怎么删除吧~不多说,这个时候回来再次输入ssh -T -i ~/.ssh/id_rsa git@github.com,效果就会如下:

说明你已经将其从原来的账户里删除掉了,这个时候再次登录你的新账户,就会添加成功,祝你好运~GitHub是个好东西!

: Tomcat started on port 40000 (http) with context path '/' 2025-09-16T11:27:13.523+08:00 ERROR 34440 --- [jnpf-boot] [ Thread-13] com.xxl.job.core.server.EmbedServer : >>>>>>>>>>> xxl-job remoting server error. java.net.BindException: Address already in use: bind at java.base/sun.nio.ch.Net.bind0(Native Method) at java.base/sun.nio.ch.Net.bind(Net.java:565) at java.base/sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:344) at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:301) at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:141) at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:561) at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1281) at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:600) at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:579) at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:922) at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:259) at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:380) at io.netty.util.concurrent.AbstractEventExecutor.runTask$$$capture(AbstractEventExecutor.java:173) at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:166) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:1583) 2025-09-16T11:27:13.551+08:00 INFO 34440 --- [jnpf-boot] [ main] o.s.s.quartz.SchedulerFactoryBean : Starting Quartz Scheduler now 2025-09-16T11:27:13.551+08:00 INFO 34440 --- [jnpf-boot] [ main] org.quartz.core.QuartzScheduler : Scheduler quartzScheduler_$_NON_CLUSTERED started. 2025-09-16T11:27:13.584+08:00 INFO 34440 --- [jnpf-boot] [ main] jnpf.JnpfAdminApplication : Started JnpfAdminApplication in 37.067 seconds (process running for 38.286) 2025-09-16T11:27:13.612+08:00 WARN 34440 --- [jnpf-boot] [ main] o.s.b.c.p.m.PropertiesMigrationListener : The use of configuration keys that have been renamed was found in the environment: Property source 'Config resource 'class path resource [application-dev.yml]' via location 'optional:classpath:/'': Key: spring.redis.database Line: 108 Replacement: spring.data.redis.database Key: spring.redis.host Line: 110 Replacement: spring.data.redis.host Key: spring.redis.port Line: 111 Replacement: spring.data.redis.port Key: spring.redis.timeout Line: 113 Replacement: spring.data.redis.timeout Each configuration key has been temporarily mapped to its replacement for your convenience. To silence this warning, please update your configuration to use the new keys. 2025-09-16T11:27:13.613+08:00 ERROR 34440 --- [jnpf-boot] [ main] o.s.b.c.p.m.PropertiesMigrationListener : The use of configuration keys that are no longer supported was found in the environment: Property source 'Config resource 'class path resource [application-dev.yml]' via location 'optional:classpath:/'': Key: spring.redis.lettuce.pool.max-active Line: 116 Reason: none Key: spring.redis.lettuce.pool.max-idle Line: 119 Reason: none Key: spring.redis.lettuce.pool.max-wait Line: 117 Reason: none Key: spring.redis.lettuce.pool.min-idle Line: 118 Reason: none Please refer to the release notes or reference guide for potential alternatives.
最新发布
09-17
# 解决 XXL-JOB 端口冲突和配置过时问题 您的日志显示了两个主要问题:XXL-JOB 端口冲突和 Spring Boot 配置属性过时问题。 ## 1. XXL-JOB 端口冲突问题 错误信息: ``` java.net.BindException: Address already in use: bind ``` ### 解决方案 #### 方法1:更改 XXL-JOB 服务端口 在您的配置文件中(通常是 `application.yml` 或 `application-dev.yml`)添加或修改以下配置: ```yaml xxl: job: executor: port: 29999 # 改为其他可用端口 ``` #### 方法2:查找并终止占用端口的进程 1. 找出占用端口的进程: ```bash # Linux/Mac lsof -i :40000 # Windows netstat -ano | findstr 40000 ``` 2. 终止占用进程: ```bash # Linux/Mac kill -9 <PID> # Windows taskkill /PID <PID> /F ``` #### 方法3:使用随机端口(测试环境) ```yaml xxl: job: executor: port: 0 # 系统将分配随机可用端口 ``` ## 2. Spring Boot 配置属性过时问题 日志中显示了多个 Redis 相关配置已过时或被重命名。 ### 解决方案 更新您的 `application-dev.yml` 文件: ```yaml # 旧的 Redis 配置(需要更新) spring: redis: database: 0 host: localhost port: 6379 timeout: 3000 lettuce: pool: max-active: 8 max-idle: 8 max-wait: -1 min-idle: 0 # 新的 Redis 配置(推荐) spring: data: redis: database: 0 host: localhost port: 6379 timeout: 3000 lettuce: pool: enabled: true # 需要显式启用连接池 max-active: 8 max-idle: 8 max-wait: -1 min-idle: 0 ``` ### 重要变更说明 1. `spring.redis.*` 前缀已改为 `spring.data.redis.*` 2. Lettuce 连接池配置现在需要显式启用(`lettuce.pool.enabled: true`) 3. 某些连接池配置可能已被移除,请参考 [Spring Boot 3.0 迁移指南](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide) ## 3. 其他建议 1. 确保您的 XXL-JOB 版本与 Spring Boot 3.x 兼容 2. 检查是否有多个配置文件冲突(如同时存在 application.yml 和 application-dev.yml) 3. 考虑使用 `@ConfigurationProperties` 进行类型安全的配置管理 4. 对于生产环境,建议使用固定端口而非随机端口
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值