SSH-Keygen “no such file or directory”

The command could not save your key, likely because it was unable to determine your $HOME directory. Specify a file, at a location where you have write access:

ssh-keygen -t rsa -b 4096 -C "my@emailaddress.com" -f /path/to/key

This will save your private key in /path/to/key and the public key in /path/to/key.pub.
When successful,
instead of an error message, you will see something like:

Your identification has been saved in /path/to/key.
Your public key has been saved in /path/to/key.pub.
The key fingerprint is:
76:f7:82:04:1e:64:eb:9c:df:dc:0a:6b:26:73:1b:2c
The key's randomart image is:
+--[ RSA 2048]----+
|        o        |
|       o .       |
|        +        |
|       + +       |
|        S o .    |
|       . = = o   |
|        E * + o  |
|        o.++ o   |
|         *o..    |
+-----------------+

And then, to make ssh look for the file at the custom location,
use the -i flag:

ssh -i /path/to/key -vT git@github.com

Alternatively,
if you have an authentication agent running,
you can add your key to the agent with:

ssh-add /path/to/key

Once your key is stored by the agent, you can simply do:

ssh -T git@github.com

The response should look something like:

Hi USER! You've successfully authenticated, but GitHub does not provide shell access.

And you can go ahead and clone your repository with:

git clone git@github.com:USER/REPO

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)