当前位置:网站首页>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
边栏推荐
- How to scan when Canon c3120l is a network shared printer
- 【无标题】5 自用历程
- 从小数据量 MySQL 迁移数据到 TiDB
- Install VM tools
- Detailed explanation of contextclassloader
- Cesium 点击获三维坐标(经纬度高程)
- Difference between shortest path and minimum spanning tree
- Oauth2.0 - Introduction and use and explanation of authorization code mode
- Mysql5.7 group by error
- Skywalking8.7 source code analysis (II): Custom agent, service loading, witness component version identification, transform workflow
猜你喜欢
有意思的鼠標指針交互探究
Oauth2.0 - explanation of simplified mode, password mode and client mode
Use selenium to climb the annual box office of Yien
GPS坐标转百度地图坐标的方法
Phpstudy setting items can be accessed by other computers on the LAN
【5G NR】UE注册流程
Important knowledge points of redis
Support vector machine for machine learning
Oauth2.0 - use database to store client information and authorization code
表达式的动态解析和计算,Flee用起来真香
随机推荐
Multithreading and high concurrency (7) -- from reentrantlock to AQS source code (20000 words, one understanding AQS)
MySQL帶二進制的庫錶導出導入
Use selenium to climb the annual box office of Yien
项目总结--2(Jsoup的基本使用)
Push box games C #
Selenium - 改变窗口大小,不同机型呈现的宽高长度会不一样
Read blog type data from mysql, Chinese garbled code - solved
SQL实现将多行记录合并成一行
Cesium entity (entities) entity deletion method
Scripy learning
Cesium 点击获取模型表面经纬度高程坐标(三维坐标)
认识弹性盒子flex
Project summary --01 (addition, deletion, modification and query of interfaces; use of multithreading)
Oauth2.0 - use database to store client information and authorization code
Kubernetes cluster environment construction & Deployment dashboard
pytorch练习小项目
Cesium Click to obtain the longitude and latitude elevation coordinates (3D coordinates) of the model surface
Print time Hahahahahaha
Mysql database table export and import with binary
简易密码锁