9
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Paiza Cloud SSHで接続してみた

Last updated at Posted at 2017-12-06

はじめに

Paiza Cloudとやらのサービスが開始されたので早速試してみた。
https://paiza.cloud/ja/

利用できる仮想サーバーはDockerのコンテナで動いている模様。
ちなみにOSは、Ubuntu 16.04.3 LTS(2017/12/06現在)

無料プランで動作を確認。

必要なもの

・公開鍵 (サーバー作成時にテキストを貼り付ける)
・秘密鍵 (クライアント端末で使用する)

鍵がなければ以下のコマンドで作成。

Terminal
ssh-keygen -t rsa -b 4096

生成した公開鍵の文字列をcatコマンドで表示。

Terminal
cat .ssh/id_rsa.pub 
sh-rsa ABCDB2NzaC1yc2EAAAABBCC... ←クリップボードにコピーしておく

サーバーの作成

  1. Paiza Cloudで新規サーバー作成を選択
  2. Use SSH にチェック
  3. 公開鍵を貼り付ける

1.png

SSHで接続

サーバー起動後、ポート[22]で接続しようとしても弾かれる。
フォワーディングされているポート番号を確認する。

  1. メニュー → About container...
  2. 「22/tcp」で検索

この"HostPort"がSSHの接続ポートとなる。

2.png

接続先は下記となる。
ユーザ名: ubuntu
ホスト名: <サーバ名>.paiza-user.cloud

Terminal
ssh -i .ssh/id_rsa ubuntu@hoge.paiza-user.cloud -p 52021

下記の結果が表示されれば、接続完了。

Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.13.0-16-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

ubuntu@hoge:~$ 
9
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?