MacOS通过vscode远程连接服务器助力协同作业
Posted 地球太危险了
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MacOS通过vscode远程连接服务器助力协同作业相关的知识,希望对你有一定的参考价值。
目录
一、下载Remote-SSH并配置SSH信息
首先在Extension里面搜索Remote-SSH下载:
然后点击左下角绿色按钮进行SSH配置:
选择Open Configuration File。然后选择本机用户的ssh配置文件进行配置:
在配置文件最后面追加以下内容:
Host 服务器IP地址
HostName 服务器IP地址
User 用户名
port 22
二、生成SSH的key并放置远程服务器上
1、首先生成ssh的key,这个教程有很多,例如:
RSA SSH keys
If you use RSA keys for SSH, the US National Institute of Standards and Technology recommends that you use a key size of at least 2048 bits. By default, the ssh-keygen
command creates an 1024-bit RSA key.
You can create and configure an RSA key with the following command, substituting if desired for the minimum recommended key size of 2048
:
ssh-keygen -t rsa -b 2048 -C "email@example.com"
The -C
flag, with a quoted comment such as an email address, is an optional way to label your SSH keys.
You’ll see a response similar to:
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
2、将生成的ssh key放置远程服务器,使用以下命令:
ssh-copy-id your-user-name-on-host@host-fqdn-or-ip-goes-here
for example: ssh-copy-id root@172.0.0.1
以上是关于MacOS通过vscode远程连接服务器助力协同作业的主要内容,如果未能解决你的问题,请参考以下文章
一对一,屏对屏,菊风远程同屏解决方案,助力多行业实现数字化协同