I will explain the initial setting of Github and the management method using ssh.
↓
This tutorial will explain the initial settings after registering an account.
↓
I will describe the terminal used this time. Reproducibility may be improved by using the same terminal.
↓
Microsoft Surface Laptop 3 – 13.5
New Microsoft Surface Laptop 3 – 15
NEW Microsoft Surface Pro X – 13
マイクロソフト Surface Laptop 3 13.5インチ
マイクロソフト Surface Laptop 3 15インチ
↓
From here you can configure the Github.
↓
Visit Github and log in
↓
↓
If you don't have a Github account, I'd be very happy if you could create one (I'm not saying, just thinking
↓
Create an account and log in
↓
Click the icon in the upper right
↓
https://github.com/settings/profile
Click on settings
↓
https://github.com/settings/keys
Click Click SSH and GPG keys
↓
Click New SSH key
↓
Once you have reached this point, set up Windows while keeping this status.
↓
Open an internet browser, copy and paste the URL, and download the zip file.
↓
Visual studio code zip download
↓
Unzip the downloaded zip file
↓
Double-click Code.exe in the unzipped file to execute
↓
Click on terminal
↓
Click New Terminal
↓
Confirm that it is a power shell
↓
Enter choco install git
in powershell and enter
↓
Do you want to run ~ enter y
and Enter
↓
After install, Click Powershell
↓
Click Select Default Shell
↓
Click Git Bash
↓
Close the VS code and reopen it.
↓
The VS code terminal has been changed to Gitbash.
↓
Create an SSH key from here.
↓
Githubでは Secure Shell(セキュアシェル、SSH)を使ってファイル管理を行います。それに伴い暗号化キーの作成を行います。
↓
Security can be strengthened by outputting a random keyword and using it as an encryption key. This is handy if you're wondering what your password is.
↓
For bash
↓
cat /dev/urandom | tr -dc 'a-zA-Z0-9!@#$%^&*()_+?><~\;' | fold -w 16 | head -n 1
↓
Outputs a code consisting of 32 lowercase letters and numbers
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
↓
Outputs a code consisting of 20 lowercase letters, uppercase letters, and numbers
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1
↓
Outputs code of 16 lowercase letters and uppercase letters, numbers, and symbols
cat /dev/urandom | tr -dc 'a-zA-Z0-9!@#$%^&*()_+?><~\;' | fold -w 16 | head -n 1
↓
/SU7Ilh4xM8bav27
It will come out. If you have any problems with Passphrase, it is easy to output Passphrase by the above method. Be sure to write down passwords.
↓
↓
cd
↓
Just cd and press [Enter] to return to the document root.
↓
cd .ssh
↓
Type cd .ssh
to run
↓
If you return bash: cd: .ssh: no such file or directory, the file does not exist on your PC.
↓
type mkdir .ssh
and enter
↓
type cd .ssh
and enter
↓
What is the ed25519 encryption key
↓
If you create an encryption key, it is logically possible for an outsider to A way to make it impossible to crack or hack.
↓
There is only a tutorial that uses rsa method for the encryption method using ssh in the upper search on Google, but ed25519 cipher What is the activation key? is more reasonable. Nonetheless, almost all the contents of the tutorial that came out hit only the explanation in the rsa method.
↓
Very irrational in terms of knowledge optimization and rationalization. Do not blindly believe the Google search results in Japanese
↓
Even with the rsa method, the encryption strength is high, so there is almost no current situation where it is cracked from the outside (except if quantum computers start to spread).
↓
Type
↓
ssh-keygen -t ed25519 -C github -b 4096
↓
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/
↓
Will appear
↓
Type
↓
id_ed25519_github
↓
githubの暗号化keyだと分かる用に名前の最後に _github
を組み込み id_ed25519_github
id_ed25519_github.pub
という名前で作成
↓
Enter passphrase (empty for no passphrase):
↓
Enter Passwords to connect to Github with ssh
↓
Enter same passphrase again:
↓
Enter Passwords again to connect to Github with ssh
↓
Your identification has been saved in id_ed25519_github.
Your public key has been saved in id_ed25519_github.pub.
The key fingerprint is:
SHA256:y21F/V6levwIbF5SSoOWyzUasJ6j+3qTSGlFgAejdYs github
The key's randomart image is:
+--[ED25519 256]--+
| +oo. |
| o.+... . |
| . E.... . . .|
| .o + o.|
| oS = * o o|
| +o * O B ..|
| o .*.* B + .|
| ..+o o = o |
| +=.. . . .|
+----[SHA256]-----+
↓
If it is output, it is successful.
↓
What is the last written AA ([Ascii Art] (https://en.wikipedia.org/wiki/AsciiArt))? If another person changes the encryption key, this figure (AA) changes It is a function to make it easier to notice the change.
↓
Type
↓
ls
↓
id_ed25519_github id_ed25519_github.pub
↓
If it is output, it is successful.
↓
The public key with the .pub extension is to be registered with the service to which you want to connect with SSH, such as GitHub. During SSH communication, the private key at hand is compared with the public key registered in the communication destination, and authentication succeeds. As a result, only you, who has the private key, are allowed to communicate.
↓
cat id_ed25519_github.pub
↓
Output encryption key
↓
ssh-ed25519 AAAAAAAAAAAA1JIoEFCNT7h/07Nza8xHy8jloKg621lZDI1Q7TmerS5tE5IMgkDLVdSB github
↓
Copy the output code from ssh ~ github
↓
Go back to the Github site that you had put on hold
↓
-t | Specify the encryption method. Specify the ed25519 encryption method with -t ed25519
and the rsa method with-t rsa
-C | Enter a comment Make it easier to understand by commenting with -C this_is_githubssh !!!
etc.
-b | Specify the encryption key length. The default is 2048
. If you specify -b 4096
etc., it will be hard to crack
-N | Specify password
↓
ssh-keygen -t ed25519 -C github -f /home/user/.ssh/id_ed25519_github -N passwordsdayo! -b 4096
↓
In the sample of ↑
↓
Select ed25519 encryption method with -t ed25519
Comment with github on -C github
Output with -f /home/user/.ssh/id_ed25519_github
with the file nameid_ed25519_github
in the /home/user/.ssh/
hierarchy
Specify passwords as passwordsdayo!
With -N passwordsdayo!
Specify cipher length of 4096bit with -b 4096
↓
If you remember even the above shortcuts, I think that there is no problem in using it normally.
↓
id_ed25519_github.pub
on Github|作った id_ed25519_github.pub
をGithubに登録Paste the passphrase you copied earlier into the key
↓
Paste the passphrase you copied earlier into the key
↓
Title win-ssh-github
Key <your code output in cat id_ed25519_github.pub>
↓
Enter a descriptive name for the title local-ssh-github I think it is safe.
↓
The purpose is to manage which private key is specified when connecting to GitHub via SSH. For example, if you previously created an ed25519 encrypted Key to connect to a VPS, you will not be able to access existing files. So create a config file inside .ssh
to manage ssh connection
↓
nano ~/.ssh/config
↓
Enter the code and enter
↓
I'm using a safe nano as an editor, but any favorite easy-to-use editor is fine
↓
Host git
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_github
↓
Write the code shown
↓
After writing, save with Ctrl + s
↓
Exit nano with Ctrl + x
↓
cat ~/.ssh /config
to check if writing is successful
↓
Host git
Specify the character string to execute the command with. With the above contents, the following statement is executed by executing ssh git
.
↓
Host tadokorokoji
↓
When set to ssh tadokorokoji
, the following statement is executed.
↓
HostName github.com
This is fixed at github.com
. Specifying HostName.
↓
User git
This is also fixed with User git
.
↓
IdentityFile ~/.ssh /id_ed25519_github
This specifies the private key. In the above contents, id_ed25519_github in the .ssh hierarchy is specified.
↓
Type ssh git
and enter
↓
The authenticity of host 'github.com (55.69.188.66)' can't be established.
RSA key fingerprint is SHA256:nThdCARLviKw6E5SY8XUpJbg6kGOCsl7E1IpRomTxWG.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
↓
Type yes
and enter
↓
Warning: Permanently added 'github.com,11.22.114.69' (RSA) to the list of known hosts. Enter passphrase for key '/home/user/.ssh/id_ed25519_github':
↓
Enter the password you set when you created id_ed25519_github
↓
PTY allocation request failed on channel 0
Hi
↓
If it comes out, it is successful.
↓
Microsoft Surface Laptop 3 – 13.5
New Microsoft Surface Laptop 3 – 15
NEW Microsoft Surface Pro X – 13
マイクロソフト Surface Laptop 3 13.5インチ
マイクロソフト Surface Laptop 3 15インチ
↓
Thank you I'm glad if you can use it as a reference. Thank you for watching until the end.
↓
windows10 initial app uninstall
Windows 10 Privacy and Security Settings
Windows10 Cortana disable setting
Windows 10 extension display, hidden file display initial setting
Windows 10 hosts privacy setting
――――――――――
↓
Thank you for watching until the end. I'm glad if you can use it as a reference.
↓
We will continue to update useful information. If you don't mind, please donate. If you donate, I'll be happy to jump.