当前位置:网站首页>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
边栏推荐
- IE browser flash back, automatically open edge browser
- GPS坐标转百度地图坐标的方法
- Exportation et importation de tables de bibliothèque avec binaires MySQL
- Click cesium to obtain three-dimensional coordinates (longitude, latitude and elevation)
- The most classic 100 sentences in the world famous works
- 使用 Abp.Zero 搭建第三方登录模块(一):原理篇
- Use @data in Lombok to simplify entity class code
- Mysql5.7 group by error
- Common interview questions
- The mechanical hard disk is connected to the computer through USB and cannot be displayed
猜你喜欢

YOLOV1学习笔记

Creating postgre enterprise database by ArcGIS

Kubesphere - set up redis cluster

tabbar的设置

Use selenium to climb the annual box office of Yien

Support vector machine for machine learning

Oauth2.0 - using JWT to replace token and JWT content enhancement

Oauth2.0 - explanation of simplified mode, password mode and client mode

GPS坐标转百度地图坐标的方法

Clickhouse learning notes (I): Clickhouse installation, data type, table engine, SQL operation
随机推荐
When PHP uses env to obtain file parameters, it gets strings
Disruptor learning notes: basic use, core concepts and principles
Cesium 点击获取模型表面经纬度高程坐标(三维坐标)
Kubernetes notes (V) configuration management
Leetcode problem solving summary, constantly updating!
Jackson: what if there is a lack of property- Jackson: What happens if a property is missing?
Kubesphere - Multi tenant management
表达式的动态解析和计算,Flee用起来真香
Project summary --2 (basic use of jsup)
[system design] proximity service
Mysql database
Une exploration intéressante de l'interaction souris - pointeur
轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
Oauth2.0 - Introduction and use and explanation of authorization code mode
Tabbar settings
opencv
Page text acquisition
After the Chrome browser is updated, lodop printing cannot be called
[set theory] equivalence relation (concept of equivalence relation | examples of equivalence relation | equivalence relation and closure)
从 Amazon Aurora 迁移数据到 TiDB
