LoginSignup
0
1

More than 5 years have passed since last update.

Bash on Ubuntu on Windows に外部からSSHで接続する

Last updated at Posted at 2018-06-12

Windows側の設定

Bash on Ubuntu on Windows をこちらで使用可能な状態にしておく。

手順

  1. Windowsファイアウォール詳細設定画面を開く
  2. 受信の規則をクリック
  3. 右側に[新しい規則...]があるので、クリック
  4. 任意のTCPポートで22番を開放する
  5. 送信の規則でも同じことを行う
  6. bashを起動
  7. コマンドを実行
$ cd ~
$ mkdir .ssh
$ cd .ssh
$ touch authorized_keys
$ vim authorized_keys

# ここで接続する側のRSA公開鍵を入力

$ vim /etc/ssh/sshd_config

# AuthorizedKeysFile %h/.ssh/authorized_keys のコメントアウトを解除する

$ sudo service ssh start

以上

あとは、いつもどおりSSH接続をすればOK

ssh [ユーザ名]@[ホスト名].local

0
1
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
0
1