cursor通过ssh连接远程服务器

Windows下在c:\Users\用户\.ssh\config文件中添加如下内容:

shell 复制代码
Host remote
    HostName 192.168.6.218
    User root
    Port 22
    IdentityFile C:\Users\用户名\.ssh\id_ed25519

设置免密登录,在Windows下运行如下命令:

shell 复制代码
ssh-keygen -t ed25519 -C "cursor"

生成私钥和公钥,然后把公钥id_ed25519.pub拷贝到远程的主机上192.168.6.218,然后执行

shell 复制代码
[root@localhost ~]# cat id_ed25519.pub >> ~/.ssh/authorized_keys
[root@localhost ~]# chmod 600 ~/.ssh/authorized_keys
[root@localhost ~]# chmod 700 ~/.ssh

接下来在Windows下通过ssh远程连接主机192.168.6.218,这个时候需要输入一次密码,后面不需要再输入,接下来需要配置sshd_config

shell 复制代码
[root@localhost archery]# vi /etc/ssh/sshd_config 
#以下是增加的内容
AllowTcpForwarding yes
AllowAgentForwarding yes
[root@localhost archery]# systemctl restart sshd

否者会报错

shell 复制代码
无法连接到远程扩展主机服务器 (错误: WebSocket close with status code 1006)
相关推荐
疯狂吧小飞牛7 小时前
GPG基础指令
linux·服务器·网络
C++ 老炮儿的技术栈8 小时前
volatile使用场景
linux·服务器·c语言·开发语言·c++
hjxu20168 小时前
【OpenClaw 龙虾养成笔记一】在远程服务器,使用Docker安装OpenClaw
服务器·笔记·docker
todoitbo9 小时前
用虚拟局域网打通 Win/Mac/Linux 三端:跨设备协作的实用方案
linux·运维·macos
Sylvia-girl10 小时前
Linux下的基本指令1
linux·运维·服务器
CDN36011 小时前
360CDN SDK 游戏盾:轻量化接入 + 强防护实测
运维·游戏·网络安全
Stewie1213811 小时前
Docker 面试题
运维·docker·容器
斯班奇的好朋友阿法法11 小时前
在企业的离线内网环境的服务器部署openclaw和大模型
服务器·语言模型
星纬智联技术12 小时前
GEO E2E 自动化验证测试文章
运维·自动化·geo
天赐学c语言12 小时前
Linux - 应用层自定义协议与序列/反序列化
linux·服务器·网络·c++