SSH

最近注册了个 AWS,免费一年,一年内可以各种乱玩~

从自己的电脑连接云主机一般需要 SSH 这样的东西。既然有如此机会,干脆系统性学习下 SSH:

Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. The best known example application is for remote login to computer systems by users.

SSH provides a secure channel over an unsecured network in a client-server architecture, connecting an SSH client application with an SSH server. Common applications include remote command-line login and remote command execution, but any network service can be secured with SSH. The protocol specification distinguishes between two major versions, referred to as SSH-1 and SSH-2.

The most visible application of the protocol is for access to shell accounts on Unix-like operating systems, but it sees some limited use on Windows as well. In 2015, Microsoft announced that they would include native support for SSH in a future release.

SSH 是一种加密的网络协议,用于在非安全网络下建立到网络设备的安全链接。SSH 被广泛用于远程计算机的命令执行,类似 VPS,云主机等设备都需要 SSH 进行操作。

SSH 连接

建立 SSH 连接有多种方式:1. Linux/Unix 系统下Terminal直接创建 2. Linux/Unix/Windows 系统下使用三方软件创建

  1. 浏览器中创建,需要 JRE,并且很多浏览器已经不支持
  2. Chrome中使用插件创建

主要说说 Chrome 中插件的方案

Secure Shell:在 Chrome 中使用 SSH

首先下载个插件:https://chrome.google.com/webstore/detail/secure-shell/pnhechapfaindjhompbnflcldabbghjo?hl=en-US

基本上看到就知道如何使用了

EC2 在 Secure Shell 中的认证问题: NaCl plugin exited with status code 255

EC2 一般使用.pem的 Private Key 进行认证,但是在使用 Secure Shell 中经常会遇到个问题:

Host key verification failed.
NaCl plugin exited with status code 255.
(R)econnect, (C)hoose another connection, or E(x)it?

看很多讨论说原因是:SSH 需要个 Public Key,但是我们只有一个 Private Key

很多 Solution 说需要生成一个 Public Key 之类的,但是实际上 Public Key 这儿并没有任何要求,我们只需要将自己的.pem复制一份然后扩展名改成.pub即可

比如自己的 Private Key 是123.pem那么复制一份然后命名为123.pem.pub, 然后 Import 的时候都选中即可

这看起来是个偏方不过确实有用

系列文章

优雅地乱玩 Linux

参考文献