Git Bash Generate Ssh Key Directory Not Found
Posted By admin On 16.04.20You generate an SSH key through macOS by using the Terminal application. Once you upload a valid public SSH key, the Triton Compute Service uses SmartLogin to copy the public key to any new SmartMachine you provision.
- Git Bash Generate Ssh Key Directory Not Found Dead
- Git Bash Generate Ssh Key Directory Not Found On Windows 10
- Git Windows Generate Ssh Key
Joyent recommends RSA keys because the node-manta CLI programs work with RSA keys both locally and with the ssh agent. DSA keys will work only if the private key is on the same system as the CLI, and not password-protected.
About Terminal
This is a simple method to create, upload and verify an SSH Key with Drupal.org Generate a key for the first time Open the Git Bash window and change to the.ssh directory cd /.ssh If the.ssh directory does not exist, change to the user directory then create the.ssh directory and enter it. Cd mkdir.ssh cd.ssh NOTE: Do not include any spaces in your keyname as it can cause. Run 'Git Gui' (Start - Git - Git Gui) Click Help and then Show SSH Key; Click Generate Key if you do not have one already; Note:- this creates the key files under your personal profile folder C:UsersYourUserID.ssh. The peculiar thing is, it worked fine last time I used git a few months ago, and I haven't changed anything since then that seems a likely cause. I've tried the following, all to no effect: Generating new idrsa. Putting.ssh in current directory. Putting.ssh in root directory. Uninstalling msysgit and reinstalling the latest version. SSH and public key authentication are quite common in the Linux world, but I suppose many Windows admins are still unfamiliar with them. Considering the fact that Microsoft is falling more and more in love with Linux, it is probably a good idea to learn more about the main remote management protocol in the Linux world. It's irrelevant to my original issue, however. The Git Book states '.you can create them by running a program called ssh-keygen, which is provided with the SSH package on Linux/Mac systems and comes with Git for Windows.' This is untrue. Ssh-keygen does not come with Git for Windows. I can't find it anywhere in my git installation directory.
Terminal is the terminal emulator which provides a text-based command line interface to the Unix shell of macOS.
To open the macOS Terminal, follow these steps:
- In Finder, choose Utilities from the Applications folder.
- Find Terminal in the Utilities listw.
- Open Terminal.
The Terminal window opens with the commandline prompt displaying the name of your machine and your username.
Generating an SSH key
An SSH key consists of a pair of files. One is the private key, which should never be shared with anyone. The other is the public key. The other file is a public key which allows you to log into the containers and VMs you provision. When you generate the keys, you will use ssh-keygen
to store the keys in a safe location so you can bypass the login prompt when connecting to your instances.
To generate SSH keys in macOS, follow these steps:
Enter the following command in the Terminal window.
This starts the key generation process. When you execute this command, the
ssh-keygen
utility prompts you to indicate where to store the key.Press the ENTER key to accept the default location. The
ssh-keygen
utility prompts you for a passphrase.- Type in a passphrase. You can also hit the ENTER key to accept the default (no passphrase). However, this is not recommended.
You will need to enter the passphrase a second time to continue.
After you confirm the passphrase, the system generates the key pair.
Your private key is saved to the id_rsa
file in the .ssh
directory and is used to verify the public key you use belongs to the same Triton Compute Service account.
Never share your private key with anyone! |
---|
Your public key is saved to the id_rsa.pub
;file and is the key you upload to your Triton Compute Service account. You can save this key to the clipboard by running this:
Importing your SSH key
Now you must import the copied SSH key to the portal.
- After you copy the SSH key to the clipboard, return to your account page.
- Choose to Import Public Key and paste your SSH key into the Public Key field.
- In the Key Name field, provide a name for the key. Note: although providing a key name is optional, it is a best practice for ease of managing multiple SSH keys.
- Add the key. It will now appear in your table of keys under SSH.
Troubleshooting
You may see a password prompt like this:
This is because:
- You did not enter the correct passphrase.
- The private key on your Macintosh (
id_rsa
) does not match the public key stored with your Triton Compute Service account. - The public key was not entered correctly in your Triton account.
What are my next steps?
Right in the portal, you can easily create Docker containers, infrastructure containers, and hardware virtual machines.
In order to use the Terminal to create instances, set up triton
and CloudAPI as well as the triton-docker
commandline tool.
Last updated 26 February 2019.
This is a simple method to create, upload and verify an SSH Key with Drupal.org
Generate a key for the first time
Open the Git Bash window and change to the .ssh directory
cd ~/.ssh
If the .ssh directory does not exist, change to the user directory then create the .ssh directory and enter it.
NOTE: Do not include any spaces in your keyname as it can cause problem when you upload your public key to some sites.
At the Git Bash prompt, enter:ssh-keygen -t rsa (optional ' -C keyname' where keyname is anything you want
You should see:
Press 'Enter' here to accept the default
Press enter to leave the passphrase empty or you can enter password to avoid attacks as the purpose of the passphrase is usually to encrypt the private key.
Copy your Key
If you are following the exact instruction given above(i.e your current dir is .ssh), just type in Git Bash:cat id_rsa.pub
You should see something like:
Even though you can see it, right there, you can't copy and paste it unless you've changed some Windows system settings. Instead, open the id_rsa.pub file with a text editor like Notepad. It's located at /u/.ssh/ in our example. The path on your machine is visible in Git Bash after the 'Enter file in which to save the key'.
Put your key on Drupal.org
- Log in to Drupal.org.
- Click 'Your Dashboard' » Profile » SSH Keys » Add a public key
- Paste your key into the text area. Anything after the will become the title of your key, so if you've been following along, you can leave the title blank. It's purely for your convenience, so you can also name it anything you want, perhaps the name of the computer the key associates with (my laptop).
Test your key
To test your key, clone an actual project from Drupal.org. You can use the example below or locate the clone command for a project you actually need.
NOTE: The below code attempts to log you into git.drupal.org. However, you can not login until you have created your git username and agreed to the Drupal version control system rules. To do this, login into your account on drupal.org, select Your Dashboard tab, select the Profile tab, select Edit, select Git Access. On the Git Access page, you will need to agree to the Drupal version control rules and follow the rest of the instructions on this page. Once you have completed all of the drupal.org steps, you can proceed with the below code.
Also you will need to change the text 'username' to the user name you created on the Drupal.org Git Access page.
Create ssh key 4096. git clone username@git.drupal.org:project/examples.git
You should see:
Type 'yes' at the prompt and press 'Enter'.
Next you'll see something like:
OR
You will get something like below, if you have set passphrase:
Git Bash Generate Ssh Key Directory Not Found Dead
If you are not asked for a password, you have successfully set up a new SSH key.
If you're just testing, then finish by removing the clone directory you just downloaded:rm -rf examples
Attachment | Size |
---|---|
ssh_key_entry.png | 32.5 KB |
creating a new SSH key on Drupal.txt | 4.24 KB |
Comments
Spaces in your key name= a Bad key name
You should not have spaces in the key name, while you can use any name, firstname@lastname is a good choice provided it has no spaces!! Use your firstname and lastname.
If you have spaces in your name it will cause you errors.
Also in order to test using your durapl.org name - you have to make sure you agree to the get access section of your drupal profile.
Or you can use 'git@git.drupal.org'. If you agree under your profile, then you can use your 'username@git.drupal.org.
Here is a link to more on using 'git@git.drupal.org' instead of '[git-user]@git.drupal.org': Git documentation remember git-user is referring to your user name!
On that page you will find this section: Why do I need a username if I'm using SSH keys?
You don't! You can use also use the familiar git@git.drupal.org:project/[projectname].git.
Note: the instructions should have been edited to reflect some of this commentary.
- Log in or register to post comments
No problem with spaces here
I was able to insert a key-name with spaces (like 'FIRSTNAME LASTNAME@COMPUTER') and the connection, authentication, and example cloning worked fine for me.
- Log in or register to post comments
Copy your Key
when entered cat .ssh/id_rsa.pub it says 'no such file or directory'(wind xp)
- Log in or register to post comments
Dir
In the example we are already in the directory .shh so we enter:cat id_rsa.pub
- Log in or register to post comments
Please check
Please check this,
It may help you.
- Log in or register to post comments
Test your key
A question to clarify the instruction for 'Test your key.' Several individuals tried using the line: username@git.drupal.org:project/examples.git
and in return, we were asked to enter our drupal password and the test did not run. However, when we used:
git@git.drupal.org
the Test ran successfully. Could it be that the 'username' option is no longer valid and should be removed?
- Log in or register to post comments
Yes, I agree! It seems like
Yes, I agree! It seems like it nowadays is git@git.drupal.org that is valid.
- Log in or register to post comments
A bit of a subtlety for NetBeans in Windows
Git Bash Generate Ssh Key Directory Not Found On Windows 10
Took me forever to get NetBeans' built-in git capabilities to work. After a lot of googling, I discovered that Netbeans doesn't like PPK files, it needs OpenSSH key files in order to connect with key based authentication
The fix:
- Download PuTTY Key Generator.
- Open your PPK file. (File > Load Private Key)
- Convert your file. (Conversions > Export OpenSSH Key)
- Load this as your key file in Netbeans.
- Log in or register to post comments
Permission denied (publickey)
I generated and posted public and private keys according to this instructions.
But when I try to clone Drupal project I always get 'Permission denied (publickey)'. Log below:
GIT_SSH_COMMAND='ssh -vvv' git clone romanblanyar@git.drupal.org:project/examples.git
Cloning into 'examples'..
OpenSSH_7.6p1, OpenSSL 1.0.2n 7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving 'git.drupal.org' port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to git.drupal.org [140.211.10.58] port 22.
debug1: Connection established.
debug1: identity file /c/Users/ASUS/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/ASUS/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/ASUS/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/ASUS/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/ASUS/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/ASUS/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/ASUS/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/ASUS/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1 Debian-10+deb9u6
debug1: match: OpenSSH_7.4p1 Debian-10+deb9u6 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to git.drupal.org:22 as 'romanblanyar'
debug3: hostkeys_foreach: reading file '/c/Users/ASUS/.ssh/known_hosts'
debug3: record_hostkey: found key type ECDSA in file /c/Users/ASUS/.ssh/known_hosts:4
debug3: load_hostkeys: loaded 1 keys from git.drupal.org
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes256-cbc,aes192-cbc
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes256-cbc,aes192-cbc
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: aes128-ctr MAC: umac-64-etm@openssh.com compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: umac-64-etm@openssh.com compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:FeJiekFTTnXWc1GDUfFVcRckyZkZfdmks1dSqtS6OVg
debug3: hostkeys_foreach: reading file '/c/Users/ASUS/.ssh/known_hosts'
debug3: record_hostkey: found key type ECDSA in file /c/Users/ASUS/.ssh/known_hosts:4
debug3: load_hostkeys: loaded 1 keys from git.drupal.org
debug3: hostkeys_foreach: reading file '/c/Users/ASUS/.ssh/known_hosts'
debug3: record_hostkey: found key type ECDSA in file /c/Users/ASUS/.ssh/known_hosts:4
debug3: load_hostkeys: loaded 1 keys from 140.211.10.58
debug1: Host 'git.drupal.org' is known and matches the ECDSA host key.
debug1: Found key in /c/Users/ASUS/.ssh/known_hosts:4
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 4294967296 blocks
debug2: key: /c/Users/ASUS/.ssh/id_rsa (0x600061280)
debug2: key: /c/Users/ASUS/.ssh/id_dsa (0x0)
debug2: key: /c/Users/ASUS/.ssh/id_ecdsa (0x0)
debug2: key: /c/Users/ASUS/.ssh/id_ed25519 (0x0)
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:HLFtcymoCmVjcR1GmuK8K/IJYNMlqWxW6oqAi6nlPXA /c/Users/ASUS/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug1: Trying private key: /c/Users/ASUS/.ssh/id_dsa
debug3: no such identity: /c/Users/ASUS/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /c/Users/ASUS/.ssh/id_ecdsa
debug3: no such identity: /c/Users/ASUS/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /c/Users/ASUS/.ssh/id_ed25519
debug3: no such identity: /c/Users/ASUS/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
romanblanyar@git.drupal.org: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
- Log in or register to post comments
fatal: Could not read from remote repository.
Getting the below error when clone the project.
Please help me to fix the issue, note that i have added my SSH public key in drupal.org.
Thanks in advance.
Git Windows Generate Ssh Key
- Log in or register to post comments