Generation of ssh keygen in Chrome OS

I've just bought a machine with Chrome OS installed. I need to connect via ssh to a remote server, which needs to have my generated keygen to grant me any access to it. I am following the instructions Esc + Refresh (F3) + Power button in order to go to the Developer mode, but it just closes my login session and does nothing but spending my time. Command ssh-keygen does not exist in chrosh.

Would you help me to find out a solution?


Solution 1:

First taking look at https://sites.google.com/site/chromeoswikisite/home/tips-and-tricks: Private keys have to be generated on a different computer and copied to the File Shelf of the Chromebook via SD Card.

Now after you have generated your key and copied it to SD card, take a look at this page :

Download your key to the Downloads directory. I keep an encrypted copy of my key in Google Drive.
Press Ctrl-Alt-T to open a terminal tab.
At the crosh> prompt, type the following:
    ssh
    user <your-user-name>
    host <your-host-name>
    key <your-key-filename> (not the full path)
    connect

Solution 2:

Aware this post hasn't been posted on for over a year however I think this may work:

  1. Install Chromebrew
  2. Now install libssh2 (think this package is for generating) by typing in crew install libssh2

NOTE: You need to have dev mode enabled. NOTE 2: I'm posting this for others who may want to do this.

Solution 3:

If you don't have access to a machine with ssh-keygen or want to generate the key completely locally, you can use this stand-alone page [1] which is a modified version of https://js-keygen.surge.sh/ but with the config options not broken and the site downloadable as a single file. It does not send the keys anywhere or save them in the cloud.

To generate an SSH keypair, you can click "Generate" with the default options and then click "Save" for each key of the pair.

[1] Just in case, I have mirrored this page here: https://scito.surge.sh/js-keygen.html

Solution 4:

The 2020 answer to this question is that most Chromebooks have the ability to run Linux apps via Crostini.

You can install the Linux apps feature and launch the Terminal application which gives you a Debian Linux "container" where you can install the ssh-client package using sudo apt update && sudo apt install ssh-client or sudo apt-get update && sudo apt-get install ssh-client to get the ssh-keygen tool and have the ability to generate an RSA or ECDSA key with ssh-keygen -t rsa -b 4096.

Note that if using RSA you'll want to ensure you are using 4096 bits as the 1024 and 2048 bit versions are considered potentially unsafe as there have been some advances in cryptography that allow reversing a public key to a private key using cloud services or access to a large compute cluster and while that is probably limited currently to targets of nation-state attacks, within a few years that may become far more feasible on consumer hardware or trivially inexpensive in the cloud.