ROS wstool-----无法从github下载源码解决

来源:互联网 发布:实用新型专利 软件 编辑:程序博客网 时间:2024/05/18 00:22

  学习《Learning ROS for Robotics Programming - Second Edition》 时候从github下载源码报如下错误,后来发现是SSH key没有配置导致的问题。

wstool up -j8

error log如下:

[ros_book] Fetching git@github.com:AaronMR/Learning_ROS_for_Robotics_Programming_2nd_edition.git (version None) to /home/dev/lrrp_2nd_ws/src/ros_book
Cloning into '/home/dev/lrrp_2nd_ws/src/ros_book'...
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Exception caught during install: Error processing 'ros_book' : [ros_book] Checkout of git@github.com:AaronMR/Learning_ROS_for_Robotics_Programming_2nd_edition.git version None into /home/dev/lrrp_2nd_ws/src/ros_book failed.

ERROR in config: Error processing 'ros_book' : [ros_book] Checkout of git@github.com:AaronMR/Learning_ROS_for_Robotics_Programming_2nd_edition.git version None into /home/dev/lrrp_2nd_ws/src/ros_book failed.


配置SSH key大致过程如下:

1)Check that you are connecting to the correct server

ssh -vT git@github.comOpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011debug1: Reading configuration data /Users/you/.ssh/configdebug1: Reading configuration data /etc/ssh_configdebug1: Applying options for *debug1: Connecting to github.com [192.30.252.131] port 22.

如果输出如下“-1”,表示找不到文件,

ssh -vT git@github.com...debug1: identity file /Users/you/.ssh/id_rsa type -1debug1: identity file /Users/you/.ssh/id_rsa-cert type -1debug1: identity file /Users/you/.ssh/id_dsa type -1debug1: identity file /Users/you/.ssh/id_dsa-cert type -1...debug1: Authentications that can continue: publickeydebug1: Next authentication method: publickeydebug1: Trying private key: /Users/you/.ssh/id_rsadebug1: Trying private key: /Users/you/.ssh/id_dsadebug1: No more authentication methods to try.Permission denied (publickey).

如果没有那么创建新的SSH key即可。

2)Generating a new SSH key

  1. Open Terminal.

  2. Paste the text below, substituting in your GitHub email address.

    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

    This creates a new ssh key, using the provided email as a label.

    Generating public/private rsa key pair.
  3. When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.

    Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
  4. At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".

    Enter passphrase (empty for no passphrase): [Type a passphrase]Enter same passphrase again: [Type passphrase again]

3)Adding your SSH key to the ssh-agent

  1. Ensure ssh-agent is enabled:

    # start the ssh-agent in the backgroundeval "$(ssh-agent -s)"Agent pid 59566
  2. Add your SSH key to the ssh-agent. If you used an existing SSH key rather thangenerating a new SSH key, you'll need to replace id_rsa in the command with the name of your existing private key file.

    $ ssh-add ~/.ssh/id_rsa
4)Adding a new SSH key to your GitHub account

  1. Copy the SSH key to your clipboard.

    If your SSH key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.

    $ sudo apt-get install xclip# Downloads and installs xclip. If you don't have `apt-get`, you might need to use another installer (like `yum`)$ xclip -sel clip < ~/.ssh/id_rsa.pub# Copies the contents of the id_rsa.pub file to your clipboard

    Tip: If xclip isn't working, you can locate the hidden.ssh folder, open the file in your favorite text editor, and copy it to your clipboard.

  2. Settings icon in the user barIn the top right corner of any page, click your profile photo, then clickSettings.

  3. Authentication keysIn the user settings sidebar, clickSSH and GPG keys.

  4. SSH Key buttonClickNew SSH key or Add SSH key.

  5. In the "Title" field, add a descriptive label for the new key. For example, if you're using a personal Mac, you might call this key "Personal MacBook Air".
  6. The key fieldPaste your key into the "Key" field.
  7. The Add key buttonClickAdd SSH key.
  8. Sudo Mode DialogIf prompted, confirm your GitHub password.



0 0
原创粉丝点击