
最近在linux mint上使用codex cli登陆的时候,返回登陆失败等问题
问题分析
是Codex在终端内没有配置proxy的问题
相关报错
Token exchange failed: token endpoint returned status 403 Forbidden
解决方法
windows powershell
Windows 系统(CMD/PowerShell)
:: CMD命令行
set http_proxy=http://127.0.0.1:7890
set https_proxy=http://127.0.0.1:7890
:: 关键!排除本地地址,防止登录时被代理拦截导致卡死
set no_proxy=127.0.0.1,localhost,::1
:: PowerShell
$env:http_proxy = "http://127.0.0.1:7890"
$env:https_proxy = "http://127.0.0.1:7890"
$env:no_proxy = "127.0.0.1,localhost,::1"
Linux/macOS 系统(终端)
# 临时生效(当前终端会话)
export http_proxy=http://127.0.0.1:7890
export https_proxy=http://127.0.0.1:7890
export no_proxy=127.0.0.1,localhost,::1
# 永久生效(写入配置文件)
echo "export http_proxy=http://127.0.0.1:7890" >> ~/.bashrc
echo "export https_proxy=http://127.0.0.1:7890" >> ~/.bashrc
echo "export no_proxy=127.0.0.1,localhost,::1" >> ~/.bashrc
source ~/.bashrc # 立即生效
评论
0 条评论加载中...