My SSH terminal connections are failing in Cycle with error adding to known hosts file.

My SSH terminal connections are failing in Cycle with error adding to known hosts file.

Problem

My SSH terminal connections are failing in Cycle with error adding to known hosts file.

Solution

SSH terminal connections use a known_hosts file stored in the user’s home directory to store server information when you establish an SSH connection.

Cycle is unable to create/write to the known_hosts file if your user directory does not already have a “.ssh” directory created within it. You will see an error message similar to the one below.

ssh_error_blurred.png

The following steps can be followed to create a “.ssh” directory in your Windows user home directory.

 

1. Open the Windows command prompt

Press Windows key + R to open the run dialog.

Type “cmd.exe” and press Enter or click OK

mceclip0.png

 

2. Navigate to your user’s home directory

The command prompt may open in your user’s home directory automatically depending on your operating system and system configuration, or you may need to navigate to your home directory.

Depending on your version of Windows and the system config you may be able to easily navigate to your home directory using the following command.

cd %USERPROFILE%

 mceclip1.png

 

If that does not work, you may need to enter the entire path of your home directory, replacing <USER_NAME> with your Windows user name.

cd \Users\<USER_NAME>

 mceclip2.png

 

3. Check to see if the .ssh directory already exists

Run the command below to check your home directory for an existing .ssh directory. You should get a “File Not Found” message. If there is already an existing .ssh directory, then you may be facing a different issue causing your SSH connections to fail.

dir .ssh

mceclip3.png

 

4. Create a .ssh directory

Run the command below to create a .ssh directory. You can then run “dir .ssh” to confirm it is created.

 mkdir .ssh

mceclip4.png

 

5. Run your feature again

Run your feature again. You should not get the same error message indicating Cycle is unable to add to the known hosts file. Cycle will create a known_hosts file in the “.ssh” directory you just created.

    • Related Articles

    • Terminal Hangs or Does Not Open

      Problem My terminal appears to hang or returns unexpected results when using the Cycle step to open a terminal connection. Potential Issues and Solutions There are several common issues that can cause failures when opening a terminal in your Cycle ...
    • How to store Connections and Credentials in Cycle

      Cycle includes the ability to save Connections and Credentials for your systems under test. Using named Connections and Credentials streamlines and simplifies declaring system access, makes Features look cleaner and promotes reusability of “set it ...
    • How to Disable Terminal Beeps

      Depending on your system under test, you may hear terminal beeps (or bells) while executing terminal tests in Cycle. This article describes a solution for silencing terminal beeps. The Cycle application does not have a sound setting itself, however, ...
    • Aligning terminal Steps with Operator behavior

      Problem My terminal-based Cycle Steps don't always perfectly coincide with the actions a human operator performs on their device. Solution There are 3 terminal Steps that can provide a clear picture of the business process and end user operation. ...
    • How to use a Custom Key Mapping File in Cycle

      Cycle has the ability to use a custom key mapping file for its terminal interactions. Some applications that Cycle interacts with require key presses beyond what can be done from the standard key mapping. Examples of this might include F keys higher ...