public:win11_wsl2_ssh
差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
| public:win11_wsl2_ssh [2024/01/23 14:17] – [ssh接続設定のファイル] hirata.nanako | public:win11_wsl2_ssh [2024/03/18 11:13] (現在) – [鍵の登録] hirata.nanako | ||
|---|---|---|---|
| 行 47: | 行 47: | ||
| wsl --install -d Ubuntu-22.04 | wsl --install -d Ubuntu-22.04 | ||
| </ | </ | ||
| - | 指示のとおり再起動する. | + | 指示のとおりシステムを再起動する. |
| ==== Ubuntu Linux の起動と初期設定 ==== | ==== Ubuntu Linux の起動と初期設定 ==== | ||
| 再起動すると自動的に Ubuntu が起動するが, | 再起動すると自動的に Ubuntu が起動するが, | ||
| 行 58: | 行 58: | ||
| ... | ... | ||
| - | </ | ||
| - | === ダウンロードアーカイブの変更と更新 === | ||
| - | Ubuntu を upgrade するためのダウンロード先 (/ | ||
| - | # /etc/apt/ に移動 | ||
| - | < | ||
| - | username@localhost: | ||
| - | </ | ||
| - | # sources.list の確認 | ||
| - | < | ||
| - | username@localhost:/ | ||
| - | apt.conf.d | ||
| - | auth.conf.d | ||
| - | </ | ||
| - | # 書き換え | ||
| - | < | ||
| - | username@localhost:/ | ||
| </ | </ | ||
| 行 83: | 行 67: | ||
| </ | </ | ||
| - | # Timezone, locale を確認し, | + | Timezone, locale を確認し, |
| < | < | ||
| username@localhost:/ | username@localhost:/ | ||
| 行 108: | 行 92: | ||
| Enter file in which to save the key (/ | Enter file in which to save the key (/ | ||
| Created directory '/ | Created directory '/ | ||
| - | Enter passphrase (empty for no passphrase): | + | Enter passphrase (empty for no passphrase): |
| - | Enter same passphrase again: | + | Enter same passphrase again: |
| Your identification has been saved in / | Your identification has been saved in / | ||
| Your public key has been saved in / | Your public key has been saved in / | ||
| 行 136: | 行 120: | ||
| 作成した鍵を ssh-agent に登録する. (# | 作成した鍵を ssh-agent に登録する. (# | ||
| < | < | ||
| - | username@localhost: | + | username@localhost: |
| Agent pid 658 | Agent pid 658 | ||
| - | username@localhost: | + | username@localhost: |
| - | Enter passphrase for / | + | Enter passphrase for / |
| Identity added: / | Identity added: / | ||
| </ | </ | ||
| 行 148: | 行 132: | ||
| </ | </ | ||
| - | ==== keychain ==== | ||
| - | 上記の方法のみではターミナルを再起動する度に鍵を ssh-agent に登録する必要がある. | ||
| - | [[https:// | ||
| - | |||
| - | < | ||
| - | username@localhost: | ||
| - | </ | ||
| - | |||
| - | .bashrc (.bash_profile) に下記を追加 | ||
| - | < | ||
| - | / | ||
| - | source $HOME/ | ||
| - | </ | ||
| ===== ssh 接続 ===== | ===== ssh 接続 ===== | ||
| 下記コマンドでssh接続する.\\ | 下記コマンドでssh接続する.\\ | ||
| 行 182: | 行 153: | ||
| - | ===== ssh接続設定のファイル ===== | ||
| - | 下記の設定をファイルに保存し ($HOME/ | ||
| - | < | + | ===== メモ ===== |
| - | Host 踏み台 | + | |
| - | | + | |
| - | ForwardX11 yes | + | |
| - | ForwardX11Trusted yes | + | |
| - | User 踏み台username | + | |
| - | HostName 踏み台サーバ | + | |
| - | </ | + | |
| - | + | ||
| - | 下記コマンドでssh接続できる. | + | |
| - | < | + | |
| - | username@localhost:~$ ssh 踏み台 | + | |
| - | </ | + | |
| ---- | ---- | ||
| * [[public: | * [[public: | ||
public/win11_wsl2_ssh.1705987045.txt.gz · 最終更新: by hirata.nanako
