Remote - SSH 配置记录
本文最后更新于:2020年7月20日 晚上
注意:这篇博文配置的本地环境为Windows10
,远端环境为Ubuntu
,参考资料在文章末尾。
1. Remote - SSH
You can:
- Develop on the same operating system you deploy to or use larger, faster, or more specialized hardware than your local machine.
- Quickly swap between different, remote development environments and safely make updates without worrying about impacting your local machine.
- Access an existing development environment from multiple machines or locations.
- Debug an application running somewhere else such as a customer site or in the cloud.
2. 配置过程
2.1 SSH keys
1. 生成本地的 SSH key pair
首先检查
Windows
上是否已有一个SSH key
,一般为C:\Users\your-user\.ssh\id_rsa.pub
。如果是macOS / Linux
,则在~/.ssh/id_rsa.pub
。如果没有则通过终端,使用以下命令生成一个
SSH key pair
1 |
|
2. 授权远端
在本地终端中运行以下命令将SSH key pair
上传至远端,注意命令的内容要根据实际进行调整
1 |
|
3. 远端安装ssh-server服务
1 |
|
2.2 问题解决
- 错误提示:
Bad owner or permissions on C:\\Users\\USER/.ssh/config
- 解决方案:setting a content in the vs codes
参考资料
本博客所有文章除特别声明外,均采用 CC BY-SA 3.0协议 。转载请注明出处!