Managing SSH Identities on Chrome OS

  05 Nov 2018     Chrome OS

The default shell in Chrome OS (“crosh” shell, invoked by Ctrl-Alt-T) only comes with a small set of command line commands. In order to get a full Linux development environment, the most convenient way is still to connect a remote server with the Secure Shell Extension (As of Nov 2019, Crostini, the Linux container on Chrome OS, has not come to many Chromebook models, e.g., my Samsung Chromebook Pro). However, because the Secure Shell App on Chrome OS is essentially browser based, it is not as straightforward as a normal Linux machine when it comes to management of ssh identities (public and secret keys) or known_hosts. This article tries to give solutions to some common issues.

Question: “WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!”

This issue happens when the host key of the server you are reaching does not match the record saved on your Chromebook. Secure Shell App blocks the connection to prevent potential man-in-the-middle attacks. However, in most cases, this simply happens after you reinstall the OS on your server. To address this issue, you can delete the corresponding entry in /.ssh/known_hosts.

First toggle the JavaScript console by Ctrl-Shift-J (within the Secure Shell App page). To delete a single record with index (the index can be found in the error message), type the following command in the console:

term_.command.removeKnownHostByIndex(INDEX);

To delete all records:

term_.command.removeAllKnownHosts();

Question: How to import ssh pub/private key identities (and delete them)?

Very often you want to use ssh keys instead of password to connect. You can import the keys by selecting the “Import…” link in the connection dialog page. Two files should be imported: one is a private key without file extension, and the other is a public which must ends in “.pub”. E.g., the keys generated by a Linux system are most liked “id_rsa” and “id_rsa.pub”.

It’s trickier To delete a saved identity (ssh key pair). To do this, you can select an identity from the dropdown and press the Delete key. However, since Chromebook does not come with Delete keys, you need to use Alt+Backspace instead.

Alternatively, to remove all keys, type the following in the JavaScript console:

term_.command.removeDirectory('/.ssh/')

References

  1. hterm/Secure Shell FAQ
  2. ChromeOS – removing SSH known_hosts from Chromebook

Kernel Update without Reinstalling Nvidia Driver

  31 Jan 2017     Linux

Fedora is always known as a cutting edge distribution with frequent updates. I love it so much expect when I have to reinstall my Nvidia driver everytime the kernel is updated. Recently I found a solution online using DKMS. DKMS, short for Dynamic Kernel Module Support, is used to automatically recompiles all DKMS modules when installing a kernel upgrade, thus allowing the drivers to continue working.

For the Nvidia driver on Fedora, simply install the DKMS package and install the Nvidia driver with “-dkms” option.

sudo dnf install dkms
sudo sh ./<DRIVER>.run --dkms

Abaqus 2016 Installation on Linux: Issues and Solutions

  18 Jan 2017     Abaqus and Linux

Recently, I installed Abaqus 2016 on a few different Linux Distros for workstations in my lab and my PC. Here’s a summary of the issues I encountered and my solutions.

Unsupported Linux Distribution

ABAQUS 2016 officially only has support for SUSE and Red Hat (and CentOS). By default, the installer runs a prerequisites check and an error will return if you runs an unsupported Linux release. I have Fedora 25 for one of my PCs and I successfully installed Abaqus 2016 on it using the following workaround.

The Abaqus installer get the release info using the script located at <installer_dir>/Linux64/1/inst/common/init/Linux.sh. I overrode the command to obtain the OS release using

DSY_OS_Release="CentOS"

I chose CentOS because Fedora is close to Red Hat Linux. I also disabled other system checks by defining environmental variable DSY_Skip_CheckPrereq in the shell before the installation.

export DSY_Skip_CheckPrereq=1

To satisfy the prerequisites of Abaqus, some additional packages must be installed. For example, the libstdc++.so.5 can be installed by

sudo dnf install compat-libstdc++-33

Now you should be able to install Abaqus on your favorite Linux distribution.

Graphical Issues

I failed to start the Abaqus/CAE when the installation done. I got an “X Error” telling me “fmd_GLContext::create(): glXCreateContext() failed”. My Nvidia driver version was 375.26. I found my problem similar to this post. They also gave a suggestion to run Abaqus using

XLIB_SKIP_ARGB_VISUALS=1 abaqus cae -mesa

This works, however, at the price of disabling the hardware acceleration. After some research online, I found this error was related to the indirect GLX rendering. In recent versions, Xorg changed its behavior to disallow indirect GLX by default, probably due to some security concerns.

I tried a few different methods to re-enable the indirect GLX rendering, including modifying the xorg.conf and adding serverargs in startx, but all failed. Finally I found solution in this post to add a wrap for Xorg command. Slightly different in my Fedora 25, my /usr/bin/Xorg is already a wrap, so I simply added the “+iglx” argument in the script:

exec "$basedir"/Xorg "$@" +iglx

Might not be a perfect solution, but hey, now Abaqus can be run natively on my Nvidia GTX 1080!

Fonts Issues

The fonts in my Abaqus/CAE GUI was extremely small and ugly at first. I solved it by installing the 100dpi font in my system:

sudo dnf install xorg-x11-fonts-ISO8859-15-100dpi-7.5-16

I have no idea why this works and I still don’t know how to switch to other fonts. Let me know if you have better ideas about that.