[Github]#3 SSH public key, for docker

Clay Ryu's sound lab·2024년 4월 14일
0

Framework

목록 보기
43/49

Adding public key to github

To get an SSH private key, you typically generate one using a tool like ssh-keygen. Here's how you can do it:

  1. Open a Terminal or Command Prompt: Depending on your operating system, open a terminal or command prompt window.

  2. Run ssh-keygen: Type the following command and press Enter:

ssh-keygen -t ed25519 -C "your_email@example.com"
  1. Choose a Location and Passphrase (Optional): You'll be prompted to choose a location to save the SSH key. The default location is usually ~/.ssh/id_ed25519. You can press Enter to accept the default location.
    You can also choose to set a passphrase for extra security, but it's optional.
cat ~/.ssh/id_ed25519.pub
  1. View the SSH Key: Once the key is generated, you can view it using a text editor or by printing it to the terminal with the following command:

Docker

If you are using docker for git process, there is an additional public key inside docker. You should add it not the key in host directory.

clay@593bebf08924:~/userdata$ ssh-keygen -t ed25519 -C "[account]@gmail.com"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/clay/.ssh/id_ed25519): 
/home/clay/.ssh/id_ed25519 already exists.
Overwrite (y/n)? 

clay@593bebf08924:~/userdata$ cat /home/clay/.ssh/id_ed25519
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW[blinded]
-----END OPENSSH PRIVATE KEY-----

clay@593bebf08924:~/userdata$ cat /home/clay/.ssh/id_ed25519.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE8uQKNiaI[blinded]
clay@593bebf08924:~/userdata$ 
profile
chords & code // harmony with structure

0개의 댓글