public:win11_wsl2_ssh_en
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
public:win11_wsl2_ssh_en [2024/03/15 15:56] – hirata.nanako | public:win11_wsl2_ssh_en [2024/03/18 11:12] (現在) – [Generate an SSH Key Pair] hirata.nanako | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== | + | ====== |
+ | 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:// | [[https:// | ||
行 10: | 行 11: | ||
===== Command install ===== | ===== Command install ===== | ||
+ | ==== Check OS version ==== | ||
+ | Start PowerShell or Command Prompt by selecting "Run as administrator" | ||
+ | |||
+ | < | ||
+ | PS C: | ||
+ | </ | ||
+ | |||
+ | ==== Select and install a Linux distribution ==== | ||
+ | Linux distributions that install WSL2 online can be found with "wsl -l -o". | ||
+ | |||
+ | < | ||
+ | |||
+ | PS C: | ||
+ | The following is a list of valid distributions that can be installed. | ||
+ | Install using ' | ||
+ | |||
+ | NAME | ||
+ | Ubuntu | ||
+ | Debian | ||
+ | kali-linux | ||
+ | Ubuntu-18.04 | ||
+ | Ubuntu-20.04 | ||
+ | Ubuntu-22.04 | ||
+ | OracleLinux_7_9 | ||
+ | OracleLinux_8_7 | ||
+ | OracleLinux_9_1 | ||
+ | openSUSE-Leap-15.5 | ||
+ | SUSE-Linux-Enterprise-Server-15-SP4 | ||
+ | SUSE-Linux-Enterprise-15-SP5 | ||
+ | openSUSE-Tumbleweed | ||
+ | </ | ||
+ | |||
+ | It can also be installed from the Microsoft Store rather than by command. | ||
+ | |||
+ | Here we install Ubuntu-22.04({{ : | ||
+ | |||
+ | < | ||
+ | wsl --install -d Ubuntu-22.04 | ||
+ | </ | ||
+ | |||
+ | Reboot the system as instructed. | ||
+ | |||
+ | ==== Ubuntu Linux startup and initial configuration ==== | ||
+ | Ubuntu will start automatically after rebooting, but if it does not, start it from the menu. Enter your client username and password. | ||
+ | < | ||
+ | Enter new UNIX username: Local_Username | ||
+ | New password: | ||
+ | Retype new password: | ||
+ | passwd: password updated successfully | ||
+ | Installation successful! | ||
+ | ... | ||
+ | |||
+ | </ | ||
+ | |||
+ | Updating Ubuntu. | ||
+ | |||
+ | < | ||
+ | username@localhost:/ | ||
+ | username@localhost:/ | ||
+ | </ | ||
+ | |||
+ | Check the timezone and locale, and change them if necessary. | ||
+ | < | ||
+ | username@localhost:/ | ||
+ | Local time: Fri 2024-01-12 11:51:24 JST | ||
+ | | ||
+ | RTC time: Fri 2024-01-12 02:51:24 | ||
+ | Time zone: Asia/Tokyo (JST, +0900) | ||
+ | System clock synchronized: | ||
+ | NTP service: inactive | ||
+ | RTC in local TZ: no | ||
+ | username@localhost:/ | ||
+ | | ||
+ | VC Keymap: n/a | ||
+ | X11 Layout: us | ||
+ | X11 Model: pc105 | ||
+ | </ | ||
+ | |||
+ | ===== Generate an SSH Key Pair ===== | ||
+ | Generate an ssh key in PowerShell. (After # are comments) | ||
+ | < | ||
+ | username@localhost: | ||
+ | Generating public/ | ||
+ | Enter file in which to save the key (/ | ||
+ | Created directory '/ | ||
+ | Enter passphrase (empty for no passphrase): | ||
+ | Enter same passphrase again: | ||
+ | Your identification has been saved in / | ||
+ | Your public key has been saved in / | ||
+ | The key fingerprint is: | ||
+ | SHA256: | ||
+ | The key's randomart image is: | ||
+ | +---[ECDSA 384]---+ | ||
+ | |+ E..+ | | ||
+ | | = =. | | ||
+ | |o o= o. | | ||
+ | |.B+ =... | | ||
+ | |XoXo +o S | | ||
+ | |B@o=o..o | ||
+ | |+o.o+oo | ||
+ | | . .o.. | | ||
+ | | o+. .. | | ||
+ | +----[SHA256]-----+ | ||
+ | </ | ||
+ | |||
+ | ===== Apply for a key ===== | ||
+ | Please apply for registration of the created public key id_ecdsa.pub. \\ | ||
+ | [[https:// | ||
+ | [[http:// | ||
+ | |||
+ | ===== Add your SSH key to the ssh-agent ===== | ||
+ | Register the created private key with ssh-agent. | ||
+ | < | ||
+ | username@localhost: | ||
+ | Agent pid 658 | ||
+ | username@localhost: | ||
+ | Enter passphrase for / | ||
+ | Identity added: / | ||
+ | </ | ||
+ | You can check if it is registered with the following command. | ||
+ | < | ||
+ | username@localhost: | ||
+ | 384 SHA256: | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== SSH Connection===== | ||
+ | Enter the following: | ||
+ | < | ||
+ | username@localhost: | ||
+ | The authenticity of host ' | ||
+ | ED25519 key fingerprint is SHA256: | ||
+ | This key is not known by any other names | ||
+ | Are you sure you want to continue connecting (yes/ | ||
+ | Warning: Permanently added ' | ||
+ | </ | ||
+ | option -A: Enables forwarding of connections from an authentication agent such as ssh-agent. | ||
+ | option -X: Enables X11 forwarding. | ||
+ | After connecting to the Jump_Server, | ||
+ | |||
+ | ==== 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:// | ||
+ | |||
+ | |||
+ | |||
+ | ---- | ||
+ | * [[public: |
public/win11_wsl2_ssh_en.1710485763.txt.gz · 最終更新: 2024/03/15 15:56 by hirata.nanako