1.修改~/.ssh/configHost remotessh HostName {host} User {username} IdentityFile ~/.ssh/id_rsa将这一段写入到config文件2.测试连接sshremotessh3.在远程机器上安装codex clicurl-fsSLhttps://chatgpt.com/codex/install.sh|sh通常情况下会被安装到~/.local/bin目录下安装后测试command-vcodex codex--version4.在远程机器上登录codexcodex login --device-auth运行后会输出如上信息在浏览器中打开输入code即可登录5.在codex上打开远程项目5.1 添加ssh连接到codex打开设置-连接-SSH。点击添加选择刚刚在~/.ssh/config文件中添加的ssh连接5.2 打开远程项目新建对话时在对话框左下角选择New remote project找到你想要的项目文件夹即可打开远程项目