Recover account from private key

I have a private key (not the seed phrase) for an old account. How can I create a keypair from that to use with the CLI?

First I don’t know what you are really asking for as maybe you are confused about how keys work. Or maybe you ask about validator key pairs as you need two keys to run validator nodes. A validator key and a voting key. But I regress, if you are asking how to use your private key with the CLI its as easy as pie. Just place the private key in a file in your HDD’s home directory location so has the pathname like this:


Where substitue your username where you see the johnycash username, unless your a good guitar player.

Now you need to set your solana config to the mainnet so issue command:

solana config set --url

Then you will use that key and the solana-keygen CLI to get the wallet public key address like so:

 solana-keygen pubkey 

Then you will get back the Public Key of your private key file looking like this:


So then whatever the pubkey is you have to use that key to tell people to send you some SOL to that public address.
Never give anyone your private key and keep it locked on your computer and never give anyone any password to your computer and save a copy of the key printed on paper as you lost the passphrase and you cannot generate the passphrase apparently very easily. wallet has some ability to do this.
Do you know if this is a private key or was it generated with the solana-keygen software? You must use the same way that you used to generate these keys to be safe so if you created it with then use that website to restore the key and check your balance. Elsewise use the solana-keygen and then only the solana transfer and solana balance commands to process funds betwixt accounts.