ユーザ用ツール

サイト用ツール


public:win11_wsl2_ssh_en

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
public:win11_wsl2_ssh_en [2024/03/18 09:57] – [Ubuntu Linux startup and initial configuration] hirata.nanakopublic:win11_wsl2_ssh_en [2024/03/18 11:12] (現在) – [Generate an SSH Key Pair] hirata.nanako
行 1: 行 1:
-====== WSL SSH In Windows 11 ====== +====== WSL2 SSH In Windows 11 ====== 
 +To access the server of the Space Environment Information Processing System via the Internet, you need to go through a login server (a Jump_Server). The login server is accessed by SSH public key authentication. 
 +In this article, we install Windows Subsystem for Linux 2 (WSL2) on Windows 11 and connect to the login server via SSH. 
 [[https://learn.microsoft.com/en-us/windows/wsl/install|How to install Linux on Windows with WSL (Microsoft)]] [[https://learn.microsoft.com/en-us/windows/wsl/install|How to install Linux on Windows with WSL (Microsoft)]]
  
行 11: 行 12:
 ===== Command install ===== ===== Command install =====
 ==== Check OS version ==== ==== Check OS version ====
-Start PowerShell or Command Prompt by selecting "Run as administrator". PowerShell or Command Prompt can also be opened in Windows Terminal. The command to check the OS version is as follows:+Start PowerShell or Command Prompt by selecting "Run as administrator". PowerShell or Command Prompt can also be opened in Windows Terminal((Terminal available by default in Windwos 11. Tabs can be used and it is easy to customize. ([[https://learn.microsoft.com/en-us/windows/terminal/|What is Windows Terminal?]] ) )). The command to check the OS version is as follows:
  
 <code> <code>
行 23: 行 24:
  
 PS C:\Windows\System32> wsl -l -o PS C:\Windows\System32> wsl -l -o
-インストールできる有効なディストリビューションの一覧を次に示します。 +The following is a list of valid distributions that can be installed. 
-'wsl.exe --install <Distro>' を使用してインストールします。+Install using 'wsl.exe --install <Distro>'.
  
 NAME                                   FRIENDLY NAME NAME                                   FRIENDLY NAME
行 88: 行 89:
 </code> </code>
  
-===== 鍵ペアの作成 ===== +===== Generate an SSH Key Pair ===== 
-ssh鍵を作成する. (#以降はコメント)+Generate an ssh key in PowerShell. (After are comments)
 <code> <code>
 username@localhost:~$ ssh-keygen -t ecdsa -b 384 username@localhost:~$ ssh-keygen -t ecdsa -b 384
行 95: 行 96:
 Enter file in which to save the key (/home/username/.ssh/id_ecdsa): Enter file in which to save the key (/home/username/.ssh/id_ecdsa):
 Created directory '/home/username/.ssh'. Created directory '/home/username/.ssh'.
-Enter passphrase (empty for no passphrase):   パスフレーズ入力 +Enter passphrase (empty for no passphrase):       #Enter passphrase 
-Enter same passphrase again:   パスフレーズ入力+Enter same passphrase again:                      #Enter passphrase
 Your identification has been saved in /home/username/.ssh/id_ecdsa Your identification has been saved in /home/username/.ssh/id_ecdsa
 Your public key has been saved in /home/username/.ssh/id_ecdsa.pub Your public key has been saved in /home/username/.ssh/id_ecdsa.pub
行 115: 行 116:
 </code> </code>
  
-===== 鍵の申請 ===== +===== Apply for a key ===== 
-作成した公開鍵 id_ecdsa.pub の登録申請をする. \\ +Please apply for registration of the created public key id_ecdsa.pub. \\ 
- [[https://portal.isee.nagoya-u.ac.jp/iseeadm-bin/acc/skplatform.cgi|isee ログインサーバ申請 (内部ページ)]] + [[https://portal.isee.nagoya-u.ac.jp/iseeadm-bin/acc/skplatform.cgi|Isee Jump_Server account request]] 
- [[http://cidas.isee.nagoya-u.ac.jp/kyodo/regist.shtml.ja|CIDASシステム申請]]+ [[http://cidas.isee.nagoya-u.ac.jp/kyodo/regist.shtml.ja|CIDAS System account request]]
  
-===== 鍵の登録 ===== +===== Add your SSH key to the ssh-agent ===== 
-作成した鍵を ssh-agent に登録する. (#以降はコメント)+Register the created private key with ssh-agent.  (After are comments)
 <code> <code>
-username@localhost:~$ eval $(ssh-agent) # ssh-agent を起動する+username@localhost:~$ eval $(ssh-agent)                      Start ssh-agent
 Agent pid 658 Agent pid 658
-username@localhost:~$ ssh-add ~/.ssh/id_ecdsa # 鍵を登録 +username@localhost:~$ ssh-add ~/.ssh/id_ecdsa                Register private key 
-Enter passphrase for /home/username/.ssh/id_ecdsa:パスフレーズ+Enter passphrase for /home/username/.ssh/id_ecdsa:           pass phrase
 Identity added: /home/username/.ssh/id_ecdsa (username@Win11) Identity added: /home/username/.ssh/id_ecdsa (username@Win11)
 </code> </code>
-登録されているかは下記コマンドで確認できる.+You can check if it is registered with the following command.
 <code> <code>
 username@localhost:~$ ssh-add -l username@localhost:~$ ssh-add -l
行 136: 行 137:
  
  
-===== ssh 接続 ===== +===== SSH Connection===== 
-下記コマンドでssh接続する.\\ +Enter the following:\\
--Aオプションは, 認証エージェントを転送する, つまりログインサーバに接続後, 続けて別のサーバに接続する際に, 最初に使った秘密鍵をそのまま使用するためにつける.\\ +
--Xオプションは X11のポートフォワーディングを有効にする(リモートマシンのXアプリケーションが実行できるようになる)+
 <code> <code>
-username@localhost:~$  ssh 踏み台username@踏み台サーバ -AX +username@localhost:~$  ssh Jump_Server_Username@Jump_Server -AX 
-The authenticity of host '踏み台サーバ' can't be established.+The authenticity of host 'Jump_Server' can't be established.
 ED25519 key fingerprint is SHA256:TTWvEs781VjJwKrzOLJVDtTbLUn/1Ut00as1oihi5QI. ED25519 key fingerprint is SHA256:TTWvEs781VjJwKrzOLJVDtTbLUn/1Ut00as1oihi5QI.
 This key is not known by any other names This key is not known by any other names
 Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
-Warning: Permanently added '踏み台サーバ' (ED25519) to the list of known hosts.+Warning: Permanently added 'Jump_Server' (ED25519) to the list of known hosts.
 </code> </code>
-踏み台サーバからさらに目的のサーバにssh接続する。 +option -A: Enables forwarding of connections from an authentication agent such as ssh-agent. 
- +option -X: Enables X11 forwarding  
-==== X11のポートフォワーディングについて ==== +After connecting to the Jump_Server, you can use the same private key that you used at the first connection to connect to another server.
-WSL2 では、デフォルトで GUI 表示ができる. X サーバを新たにインストールする必要はない\\ +
-[[https://learn.microsoft.com/ja-jp/windows/wsl/tutorials/gui-apps|Linux 用 Windows サブシステム で Linux GUI アプリを実行する]]+
  
 +==== About x11 forwarding ====
 +WSL 2 enables Linux GUI applications to feel native and natural to use on Windows. There is no need to install a new X server.\\
 +[[https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps|Run Linux GUI apps on the Windows Subsystem for Linux]]
  
  
  
-===== メモ ===== 
-  * [[public:win11_wsl2_ssh:memo|便利メモはこちら]] 
  
 ---- ----
   * [[public:macos10_openssh|OpenSSH on macOS 10.15]]   * [[public:macos10_openssh|OpenSSH on macOS 10.15]]
public/win11_wsl2_ssh_en.1710723471.txt.gz · 最終更新: 2024/03/18 09:57 by hirata.nanako

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki