14
14

More than 5 years have passed since last update.

Windows7にopensshを入れて~/.ssh/configを使う

Last updated at Posted at 2014-03-19

chocolateyをインストール

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

opensshをインストール

管理者権限のコマンドプロンプト
$ cinst openssh

~/.ssh/configを作成

適当な例

C
Host example.com
    User yourusername

環境変数HOMEを設定

変数
HOME C:\Users\yourusername

このまま実行すると、多分権限で怒られます

$ ssh example.com
Bad owner or permissions on /cygdrive/c/users/yourusername/.ssh/config

cygwinをインストール

管理者権限のコマンドプロンプト
cinst cygwin

~/.ssh/configの権限設定

cygwin
$ chown yourusername /cygdrive/c/users/yourusername/.ssh/config

$ chmod 700 /cygdrive/c/users/yourusername/.ssh/config

完了

$ ssh example.com
14
14
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
14
14