wiki
Getting startedGuidesFAQ
1.0.0
1.0.0
  • b-it-bots wiki
  • @home
    • Getting started
      • First steps
      • Setting up your development environment
        • Configuring your editor
        • Using ssh
      • Adding your first contribution
    • Tutorials
      • Architecture
    • Guides
      • git
        • Making good commits
        • Branching model
        • Adding git aliases to make your life easier
        • Creating a release
      • SSH
      • ROS
        • Creating a new package
          • Creating a new node
        • Creating a new message, service or action
        • Testing in ROS
        • Linting
      • Coding conventions
        • C++
        • Python
      • Toolkit
        • CLion
        • Atom configuration
        • Using vim
        • TMUX - Terminal Multiplexer
    • Resources
    • FAQ
      • git
  • @work
    • 2018-05-06-navigation-atwork
    • 2018-05-06-simulation_mapping
    • How to use the RealSense2 camera
    • Getting the classifier from a data set
Powered by GitBook
On this page
  • Configuring ssh
  • Creating your ssh key
  • Using ssh to login to the robots without a password

Was this helpful?

  1. @home
  2. Getting started
  3. Setting up your development environment

Using ssh

PreviousConfiguring your editorNextAdding your first contribution

Last updated 4 years ago

Was this helpful?

We often need ssh to log into the robots. You have also set up you ssh key in your GitHub account. Let's start with :

An SSH key is an access credential in the . Its function is similar to that of user names and passwords, but the keys are primarily used for automated processes and for implementing single sign-on by system administrators and power users.

If you want to know more about how the authentication procedure works, you can read more about it .

In general, you can ssh into any PC with the following commands:

ssh user@xxx.xxx.xxx.xxx

For example, if John (username: johndoe) wants to ssh into our robot Lucy, which has the IP address 123.456.7.890, he can use the following command:

ssh johndoe@123.456.7.890

Configuring ssh

An example of an can be found in the dev-env repository. Keep in mind that you will need to change at least two things:

  • username: this can be different depending on which line you are adding, but in general should match the user in the PC you are trying to access.

  • IdentityFile: which should match the key you generated when you were See the next section for more information about how to generate keys.

After you have updated the config file, you can use the following commands to ssh into different places:

ssh lucy # ssh into lucy@192.1.50.201
ssh hsr # ssh into your account in the robot, e.g. johndoe@192.1.50.201

Creating your ssh key

In general, you can create an SSH key with the following command:

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

If you want to create a separate key for your work on the team, you can specify it during the prompt instead of the default value of id_rsa. If you want to do it directly from the command line, you can use the -f flag like this:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com" -f b-it-bots.key

Using ssh to login to the robots without a password

Copy your ssh-key to the server (e.g. your user on Lucy, the workstation, the lucy account in the robot). From the ssh documentation:

Only the public key is copied to the server. The private key should never be copied to another machine

The command you would need is

ssh-copy-id -i ~/.ssh/your-ssh-key user@host

For example, to copy your key bitbots.key to the johndoe user at the IP address 123.456.7.890you can do the following:

ssh-copy-id -i ~/.ssh/bitbots.key johndoe@123.456.7.890

This logs into the server host, and copies keys to the server, and configures them to grant access by adding them to the file. The copying may ask for a password or other authentication for the server.

For more information you can read a bit more about , and the .

what an SSH key is
SSH protocol
here
ssh config file
setting up your development environment.
authorized_keys
copying your ssh-key
ssh-copy-id
authorized_keys file