LoginSignup
1
1

More than 3 years have passed since last update.

Git for Windows + OpenSSH で Windows10 を Git サーバーにする

Posted at

雑な備忘録

やりたいこと

Windows10 を git サーバーにする。
そのために以下のことをする。

  • OpenSSH で SSH サーバーを動かす
  • パスワードログインを禁止し、SSH Key でログインする
  • ssh の既定のシェルを bash にして git 操作を可能にする
  • クライアントから ssh 経由で git 操作する

OpenSSH の設定

この辺を読んでいいようにする。

クライアントからの接続

事前に SSH Key を作成し、サーバーの authorized_keys に公開鍵を追加しておくこと

リモートリポジトリが c:\repos\test.git だとすると

git remote add origin ssh://<username>@<hostname or IP>/c/repos/test.git

でリモートリポジトリを設定する。
username は Windows のユーザー名を入れること。

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