My SSH terminal connections are failing in Cycle with error adding to known hosts file.
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.
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
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.
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.
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.
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.
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.