MJ Hartman Trusted Contributor.
Trusted Contributor.
803 views

The known_hosts file couldn't be set

Jump to solution

I am trying to issue a SSH command from my workflow, but I get this error:

The known_hosts file couldn't be set

How can I resolve this?

Tags (2)
0 Likes
1 Solution

Accepted Solutions
AndreiTruta Outstanding Contributor.
Outstanding Contributor.

Re: The known_hosts file couldn't be set

Jump to solution

How is your knownHostsPolicy input set? You should play with this one according to the needs.

Do not ignore the Notes section within the SSH commnad description, in particular No. 2 described there which states:

2. Hidden inputs:
knownHostsPath - Specifies the path to the known_hots file on the running server.
Default value: <user.home>/.ssh/known_hosts

If you did not change that one and if you choosed an host policy option that alters this file you might be in an access denied situation on that specific file.

Is this error appearing when you run the SSH command in Studio or Central?

Andrei Vasile Truta
2 Replies
AndreiTruta Outstanding Contributor.
Outstanding Contributor.

Re: The known_hosts file couldn't be set

Jump to solution

How is your knownHostsPolicy input set? You should play with this one according to the needs.

Do not ignore the Notes section within the SSH commnad description, in particular No. 2 described there which states:

2. Hidden inputs:
knownHostsPath - Specifies the path to the known_hots file on the running server.
Default value: <user.home>/.ssh/known_hosts

If you did not change that one and if you choosed an host policy option that alters this file you might be in an access denied situation on that specific file.

Is this error appearing when you run the SSH command in Studio or Central?

Andrei Vasile Truta
MJ Hartman Trusted Contributor.
Trusted Contributor.

Re: The known_hosts file couldn't be set

Jump to solution

knownHostsPolicy  was set to strict. I changed it to add, and now it works fine.

Thanks!

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.