tag:crieit.net,2005:https://crieit.net/boards/github-enterprise/feed
「Github Enterprise Cloud の Gitクローンまでのメモ」の投稿 - Crieit
Crieitで「Github Enterprise Cloud の Gitクローンまでのメモ」ボードに投稿された最近の投稿
2021-04-28T11:06:19+09:00
https://crieit.net/boards/github-enterprise/feed
tag:crieit.net,2005:PublicArticle/c74278bd083beb4d7096107ed245619b
2021-04-16T21:32:34+09:00
2021-04-28T11:06:19+09:00
https://crieit.net/boards/github-enterprise/c74278bd083beb4d7096107ed245619b
公開鍵・秘密鍵を作成する鍵を入れるフォルダに移動$cd ~/.ssh適当にフォルダを作成$mk...
<h1>公開鍵・秘密鍵を作成する</h1>
<p>鍵を入れるフォルダに移動</p>
<pre><code>$cd ~/.ssh
</code></pre>
<p>適当にフォルダを作成</p>
<pre><code>$mkdir hoge
</code></pre>
<p>作成したフォルダに移動</p>
<pre><code>$cd hoge
</code></pre>
<p>鍵を生成<br />
1つ目のEnterは任意に鍵の名前を付けることが可能<br />
2つ目のEnterはパスフレーズの入力だが、無しでOK</p>
<pre><code>$ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/(username)/.ssh/id_rsa): id_hoge_rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
</code></pre>
<h1>Githubに公開鍵をアップする</h1>
<ul>
<li>「Account」->「Settings」</li>
<li>画面右上の「Add SSH key」のボタン押下</li>
<li>「title」に任意の公開鍵名を入力</li>
<li>「key」に公開鍵の中身を入力</li>
<li><code>$clip < ~/.ssh/hoge/id_hoge_rsa.pub</code> で鍵がコピー可能(Windows)</li>
<li><code>$pbcopy < ~/.ssh/hoge/id_hoge_rsa.pub</code> (Mac)</li>
</ul>
<h1>configファイルを作成する</h1>
<pre><code>#~/.ssh/config
Host github github.com
HostName github.com
IdentityFile ~/.ssh/hoge/id_hoge_rsa
User git
</code></pre>
<h1>SAML SSO を有効化する</h1>
<ul>
<li><code>SSH Keys</code> -> <code>Enable SSO</code> -> <code>Authorize</code></li>
</ul>
<h1>接続を確かめる</h1>
<pre><code>$ ssh -T [email protected]
</code></pre>
skybee8