Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1434  / 2 Years ago, wed, june 8, 2022, 8:45:45

I want to generate ssh key for github.



I follow their documentation at Generating SSH Keys.



I did all steps extends last:




xclip -sel clip < ~/.ssh/id_rsa.pub

Copies the contents of the id_rsa.pub file to your clipboard




here is my tries:



nazar@nazar-desctop:~/.ssh$ ls -lag
total 16
drwxr-xr-x 2 nazar 4096 Dec 21 16:28 .
drwxr-xr-x 39 nazar 4096 Dec 21 16:17 ..
-rw------- 1 nazar 1766 Dec 21 16:28 ssh-add id_rsa
-rw-r--r-- 1 nazar 404 Dec 21 16:28 ssh-add id_rsa.pub
nazar@nazar-desctop:~/.ssh$ xclip -sel clip < ~/.ssh/id_rsa.pub
bash: /home/nazar/.ssh/id_rsa.pub: No such file or directory


Why does this happen?




  • How to solve this trouble?


More From » xubuntu

 Answers
1

You have missed one instruction in step 2 (emphasis mine):




Step 2: Generate a new SSH key



To generate a new SSH key, enter the code below. We want the default
settings so when asked to enter a file in which to save the key, just
press enter
.



$ ssh-keygen -t rsa -C "[email protected]"
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.
# Enter file in which to save the key (/home/you/.ssh/id_rsa):
$ ssh-add id_rsa



The command ssh-keygen -t rsa -C [email protected] creates a new RSA key file with the text [email protected] in the comment section. When the command is invoked, you are asked to supply the file name. Pressing Enter in this case will use the default (/home/you/.ssh/id_rsa).



The command thereafter (ssh-add id_rsa) adds the key file to the SSH agent daemon such that you only have to enter the password once a session. (see the manual pages of ssh-add and ssh-agent).



To "recover" from this mistake, you can either remove the files ssh-add id_rsa and ssh-add id_rsa.pub and start over or rename it:



mv ~/.ssh/ssh-add id_rsa ~/.ssh/id_rsa
mv ~/.ssh/ssh-add id_rsa.pub ~/.ssh/id_rsa.pub

[#27879] Thursday, June 9, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
gigglcept

Total Points: 113
Total Questions: 105
Total Answers: 125

Location: Christmas Island
Member since Wed, Jan 13, 2021
3 Years ago
gigglcept questions
Mon, Jul 5, 21, 19:38, 3 Years ago
Thu, May 27, 21, 13:35, 3 Years ago
Tue, Feb 8, 22, 09:59, 2 Years ago
Fri, Dec 16, 22, 12:32, 1 Year ago
;