LoginSignup
0
0

More than 1 year has passed since last update.

WSL環境で ssh-keygen で作成される鍵ファイルのパーミッションが 777 から変更できない問題を解決する

Posted at

デフォルトの WSL で ssh-keygen すると、作成される鍵ファイルのパーミッションが 777 になっている。

chmod 0600 ~/.ssh/id_rsa

などとすれば良いはずだが、NTFS/FAT32等のファイルシステム上ではchmodでアクセス権を変更することができないらしい。

なので、WSL が起動時にマウントする Cドライブなど(/mnt/c/ など)をマウントし直す必要がある。

$ cat <<EOF | sudo tee -a /etc/wsl.conf
[automount]
options = "metadata"
EOF

実行後に wsl を再起動して ssh-keygen すると良い。
これで、OK。

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