I have very little knowledge about SSH etc. I was trying to add new SSH key on Github. For this I followed this procedure:
On Terminal
work#Nirvair:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/work/.ssh/id_rsa):
Created directory '/home/work/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/work/.ssh/id_rsa.
Your public key has been saved in /home/work/.ssh/id_rsa.pub.
Then there was key fingerprint and key's randomart image.
On Browser
I opened:
Github >> Settings >> SSH and GPG keys >> New SSH key
It asked for Title and Key. I gave some title and then I copied my key id_rsa.pub there. It gave an error:
Key is invalid. It must begin with 'ssh-ed25519', 'ssh-rsa', 'ssh-dss', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', or 'ecdsa-sha2-nistp521'. Check that you're copying the public half of the key
I have no idea how to proceed further. Please tell me where I am wrong or direct me to a good tutorial.
OS details: Ubuntu 14.04.5
Thanks!
PS: I tried to read about "key fingerprint" and "key's randomart image" over the internet but everything went over my head
Are you sure you perfectly copied your public key?
Execute
cat /home/work/.ssh/id_rsa.pub
and copy everything to your clipboard.
You can also try with xclip:
xclip -sel clip < /home/work/.ssh/id_rsa.pub
Related
I am trying to set up my local computer to be able to send files up on github but for some reason i am facing several issues while doing so.
So this is what it shows on cmd.
And this is what it shows on github page.
As you can notice it shows i made the last change a week so obviously my commits weren't pushed to the main branch.
Please help me figure out what the problem is here.
The name of my repo on github is MyWebsite and the local folder is mywebsite. Perhaps that is causing the issue? I also have generated a ssh key if that's a matter of concern.
Thanks.
I will go through step by step what you need to do:
1.Checking for existing SSH keys
Before you generate an SSH key, you should check if you already have an existing SSH key. You can easily check for existing SSH keys by using the Git bash and entering the following command that lists the files in the .ssh directory which has been located most often on following path C:\Users\Jakobson\.ssh. For this example I used my path from my local.
Command for checking the files where ssh keys have been stored after generating is:
ls -al ~/.ssh
By default, the filenames of the public keys are one of the following:
id_rsa.pub id_ecdsa.pub id_ed25519.pub .
If .ssh directory haven't any existing files, you should generate new ssh key which is described in next step.
2.Set up an SSH key
You can generate an SSH key by running the ssh-keygen procedure on your computer. You will need to remember where you have saved the generated public and private RSA key pair. The steps for generating a new SSH key are:
Open the Git bash.
Enter the following command by entering your GitHub email address:
ssh-keygen -t ed25519 -C "youremailaddress"
Note: If you are using a legacy system that doesn’t support the Ed25519 algorithm, use:
ssh-keygen -t rsa -b 4096 -C "youremailaddress"
This creates a new SSH key using the provided email as a label.
Next thing git bash will ask you to enter the file destination where ssh keys will be generated like this:
> Enter a file in which to save the key (/c/Users/Jakobson/.ssh/id_ed25519):[Press enter]
If you press enter, it will be saved automatically in .ssh directory, or you can specify other destination path.
Then you will be asked to enter a passphrase. You can leave it empty.
> Enter passphrase (empty for no passphrase): [Type a passphrase]
> Enter same passphrase again: [Type passphrase again]
After this, ssh keys will be generated in your .ssh directory.
3.Adding Your SSH Key to the ssh-agent
You can start the ssh-agent in the background by typing in your git-bash:
eval `ssh-agent -s
And then you can add the private key file that you have generated by typing:
ssh-add ~/.ssh/id_rsa
4.Adding the SSH Key to Your GitHub
You need to copy SSH public key to your GitHub.
Copy all content from C:\Users\Your machine name\.ssh\id_rsa.pub file
Go to https://github.com/settings/keys -> SSH and GPG keys and click on new ssh key. Name ssh key optionally, and paste content from your file. That is all.
If you want to add ssh key to specific repository on remote server, go to your repository settings, then go to deploy keys and add ssh key on the same way we did before. You can see that at this screenshot https://i.imgur.com/lPDrFN5.png
Note: If you need to type your password when you try to push on server again, type your fingerprint which has been generated after adding ssh key on your profile/settings/keys and value is something like: SHA256:rLiDkFpEz9FT3/9cNVu9NlL8BIxCS you will find that in your ssh keys of your profile.
You can create a new token at: https://github.com/settings/tokens
Generate a new token (classic); and
then try to git clone a repo.
After inserting the login name you will be asked to enter the password. Use the generated token as the password.
I'm attempting to add pbcopy < ~/.ssh/id_rsa.pub in GitHub but this is the error message I'm getting: Key is invalid. You must supply a key in OpenSSH public key format.
Any suggestions on how I can add this? I've googles several different commands.
Thanks in advance!
libsecp256k1-static/stable 20200902-1 arm
Static libraries for libsecp256k1
Try to go to the file destination (~/.ssh/id_rsa.pub) and copy past it into GitHub. Follow steps 1, 2 & 3 to get to where you want to paste it. After Copy pasting use command (in Git Bash) ssh -t git#github.com to authenticate.
For Windows users, there are two things to consider
your console should parse quotation and double quotation in the right order.
curl needs quotation for JSON properties and keys.
So how can we debug it:
Add "-v --trace-ascii -" to the curl command to see log for command.
Use echo or write-host for your data in cmd or PowerShell
It is so important to make sure that curl receives valid JSON data.
See an example for Windows PowerShell here
I'm trying to implement Sparkle into my macOS project using cocoapod.
But when following the documentation I seem to have a problem creating the public .pem file.
Command used in Terminal;
.ssh $ ssh-keygen -t dsa -b 1024
Generating public/private dsa key pair.
Enter file in which to save the key (/Users/jorgen/.ssh/id_dsa): dsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in dsa.
Your public key has been saved in dsa.pub.
According to the documentation I should have a file called dsa_pub.pem but all I end up with is dsa.pub
If anyone has a couple of minutes to give me simple step-by-step instructions how to set this up, I would be immensely appreciative.
I was going to use a DropBox folder as the https:// address. I archive the app into a .app as far as I can understand, I would zip this and put it in the DB folder? What else goes in there?
Download sparkle: https://sparkle-project.org
go to the bin folder inside the archive
open that folder in Terminal (drag and drop from folder)
call ./generate_keys to generate dsa_priv.pem and dsa_prb.pem in the same folder
I used GnuPG to create an RSA key pair xxx#xxx.com. When I created it, I set an empty passphrase.
$ gpg --gen-key
When generating the key pair, it prompts: "You need a passphrase to...", where I pressed enter twice, and it can success list public key and secret key:
$ gpg --gpg --list-keys
Now I want to sign yyy#yyy.com with xxx#xxx.com's private key.
I have tried to only press enter, but it did not work and raises an error instead:
Invalid passphrase: please try again
Please enter the passphrase to unlock the secret key.
How to bypass the error?
I want to archive my app for distribution on two computers. I exported the private key successfully and imported it to my second machine, however run into errors when imported the public key.
Everywhere I search people always mention only exporting of the private key - why is that? how can I export the public key and transfer it successfully? what am I doing wrong?
It's been broken since 2009 as reflected in this bug report.
In case that report wanders off the internet, here's the relevant instructions to import a public key pem file. You'll want to execute this in Terminal.
security import pub_key.pem -k ~/Library/Keychains/login.keychain
When you export you private key, you should get a .p12 file. Import that file on the other machine. It should have everything in it you need. You don't need to specifically export and import the public key.
Same as DougW,
But first you must directing your terminal to directory of the key
Then change the pub_key to the name of key you will import
Example:
your key on folder Documents , and the key name is my_login.pem
So, you must write in terminal
$ cd Documents
$ security import my_login.pem -k ~/Library/Keychains/login.keychain
But be careful, you must need a backslash if you key name like
$ security import \<my_login.pem\> -k ~/Library/Keychains/login.keychain
Backslash for escape character as text
https://ubuntuforums.org/showthread.php?t=1976408
Don't understand the backslash here
For Your Information
And you can import keychains with change the directory, the directory show in here
keychains directory
just let your pointer on the kind of keychain you want to know
So it will be like this
security import **yourkeyname** -k ~/Library/Keychains/System.keychain
BE CAREFUL with this
You must know what you do