当前位置:网站首页>ssh链接远程服务器 及 远程图形化界面的本地显示
ssh链接远程服务器 及 远程图形化界面的本地显示
2022-07-03 06:18:00 【昼行plus】
一、ssh链接远程服务器
这个方法有很多,这里讲两种:MobaXterm和VSCode
1.1、MobaXterm
MobaXterm配置相对简单
确定后进入命令行界面输入密码即可
1.2、VSCode
VSCode配置麻烦点,连上后可以用VSCode的拓展工具,在上面进行断点Debug都没有问题!
先安装拓展:
然后左侧边栏会有个显示屏的小图标
新建连接
输入用户名及IP(格式: ssh 用户名@IP)
选择配置文件路径(默认第一个即可)
新建窗口
选择系统类型
Continue
输入服务器密码
右下角显示IP时即连接成功
根据目标路径打开文件夹即可
不过是这么选的:
另外,
ctrl + `
可打开命令行窗口

问题与解决
如果遇到类似下面这种问题,可以参考博客解决。
先尝试删除配置文件

对比
MobaXterm能可视化文件列表,并提供下载功能!
VSCode最大亮点就是ssh连上后,VSCode其他所有拓展也可以使用,基本和本地没两样!
二、远程图形化界面的本地显示
(适用于Ubuntu)如果只是查看远程的文档,可以如下直接连接(格式: ssh://用户名@IP)
然后就直接连上了
注:此方法仅可查看远程文档内容,命令行跑ros还在探索中。
如果非要跑的话,就会像我这样(可能是我打开方式不对,还请路过的大佬教我!!!)
2.1、MobaXterm
ssh连接上后执行命令:
sudo vim /etc/ssh/sshd_config
往下拉,找到如下内容,修改为一致:
保存后执行命令:
service ssh reload
sudo apt install x11-apps
之后执行如下命令测试一下:
xclock
会出现一个这样的时钟窗口
其他窗口的可视化(比如opencv的imshow)大家可自行探索
2.2、VSCode
与MobaXterm类似,执行命令code /etc/ssh/sshd_config 修改配置文件

然后执行:
service ssh reload
sudo apt install x11-apps
但是VSCode没有DISPLAY的环境变量,需要去MobaXterm通过执行
env | grep DISPLAY
得到类似如下输出
然后回到VSCode,执行(这两句每次打开终端都得执行一遍……)
export DISPLAY=localhost:10.0
source ~/.bashrc
然后还是简单看下效果
xclock

2.3 总结
如上方法只能进行简单窗口的可视化,集成复杂功能的工具如rviz打不开(有成功的大佬还请教我!!!)
附录
参考
https://developer.horizon.ai/college/detail/id=89018995415500842
https://zhuanlan.zhihu.com/p/260189540
http://t.zoukankan.com/hellowooorld-p-10729981.html
边栏推荐
- Jedis source code analysis (II): jediscluster module source code analysis
- Fluentd is easy to use. Combined with the rainbow plug-in market, log collection is faster
- Kubesphere - build MySQL master-slave replication structure
- Leetcode problem solving summary, constantly updating!
- opencv
- 【系统设计】邻近服务
- Docker advanced learning (container data volume, MySQL installation, dockerfile)
- Oauth2.0 - explanation of simplified mode, password mode and client mode
- Luogu problem list: [mathematics 1] basic mathematics problems
- Jackson: what if there is a lack of property- Jackson: What happens if a property is missing?
猜你喜欢

Core principles and source code analysis of disruptor

深入解析kubernetes controller-runtime

SVN分支管理

Tabbar settings

The most responsible command line beautification tutorial

JMeter performance automation test

Click cesium to obtain three-dimensional coordinates (longitude, latitude and elevation)

Une exploration intéressante de l'interaction souris - pointeur

智牛股--03

从小数据量分库分表 MySQL 合并迁移数据到 TiDB
随机推荐
Analysis of Clickhouse mergetree principle
Mysql
Es remote cluster configuration and cross cluster search
Tabbar settings
Zhiniu stock -- 03
使用 Abp.Zero 搭建第三方登录模块(一):原理篇
GPS坐标转百度地图坐标的方法
Project summary --04
Some thoughts on machine learning
ThreadLocal的简单理解
PMP笔记记录
智牛股项目--05
Oauth2.0 - explanation of simplified mode, password mode and client mode
UNI-APP中条件注释 实现跨段兼容、导航跳转 和 传参、组件创建使用和生命周期函数
Synthetic keyword and NBAC mechanism
YOLOV2学习与总结
Judge whether the date time exceeds 31 days
Request weather interface format, automation
Decision tree of machine learning
Kubesphere - build MySQL master-slave replication structure
