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)
相关推荐
静谧空间20 小时前
Linux自动备份Mysql数据
linux·运维·mysql
天空属于哈夫克320 小时前
驱动级企微群控:超越模拟点击的外部群操作技术自动化
运维·自动化·企业微信
素雨迁喜20 小时前
Linux系列文章(3)指令和权限
linux·运维·服务器
EndingCoder20 小时前
反射和元数据:高级装饰器用法
linux·运维·前端·ubuntu·typescript
天天向上的鹿茸20 小时前
用cursor连接ssh服务器开发项目
运维·服务器·ssh
Sandrachao_lucky20 小时前
跨越行业边界:企业如何精准挑选可观测性平台
运维·人工智能·aiops·可观测性·可观测平台
yes_p_m20 小时前
Ubuntu误删/lib64自救指南
linux·运维·ubuntu
何以不说话20 小时前
zabbix部署及nginx的监控
运维·nginx·zabbix
翼龙云_cloud20 小时前
腾讯云渠道商:腾讯云 CVM 在搭建网站上有哪些常见问题?
服务器·云计算·腾讯云
济61720 小时前
linux 系统移植(第十期)----Linux 顶层 Makefile详谈-- Ubuntu20.04
linux·服务器·数据库