Forums

Where is SSH key generated by "ssh-keygen"?

Hello guys, i just use "ssh-keygen" command, I did it successfully. But when I want to access the folder from "Files" it does not appear, in the console it says that I do not have permissions.

ls: cannot access /home/paladine/.ssh: No such file or directory

Guides: https://www.pythonanywhere.com/forums/topic/977/#id_post_6913 https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html#SetupanSSHkey-ssh2

It certainly should generate the keyfile to the .ssh subdirectory of your home directory, at least if you just hit return to accept the default when it asks you for a location for the keyfile; here's a copy/paste of a shell in a newly-created account where it looks like it's working OK:

16:17 ~ $ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/gt20180330a/.ssh/id_rsa): 
Created directory '/home/gt20180330a/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/gt20180330a/.ssh/id_rsa.
Your public key has been saved in /home/gt20180330a/.ssh/id_rsa.pub.
The key fingerprint is:
79:a0:5c:6b:19:94:a4:30:af:f4:f0:1b:ce:e3:1b:54 gt20180330a@glenn-liveconsole3
The key's randomart image is:
+--[ RSA 2048]----+
|    o  .o.       |
|     + o.        |
|    o o E        |
|   . * + *       |
|    . B S .      |
|     + + .       |
|      *          |
|     . o         |
|      o.         |
+-----------------+
16:17 ~ $ ls /home/gt20180330a/.ssh/
id_rsa  id_rsa.pub
16:17 ~ $

Is there anything different in your console (apart from the username, of course)?

No

console

Solved, I did it again, I left everything by default and I have the folder.. Thanks

Great! Do you remember what you did differently the first time around? It might help other people if they encounter the same problem.

Sure, i did this:

ssh-keygen

Then i wrote the name of file But I did not put it with the full path.

By putting the name directly, it was saved in the directory where it was positioned. The correct thing is to write the complete path and the name of the file: Example:

Enter file in which to save the key (/home/gt20180330a/.ssh/id_rsa): /home/gt20180330a/.ssh/my_ssh_file_name

Documentation: enter image description here

I see! For future reference, if you don't put anything, it will also automatically create at the suggested location.