Feature #3367

Path to ssh key should be configurable

Added by Mark Plaksin almost 2 years ago. Updated about 1 month ago.

Status:Needs More Information Start date:03/15/2010
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:library
Target version:1.7.x
Keywords: Affected Facter version:
Branch:
Votes: 0

Description

It would be great if we could specify the location(s) that facter looks for ssh keys.

Currently ssh.rd looks for ssh keys in these directories:

[“/etc/ssh”,“/usr/local/etc/ssh”,“/etc”,“/usr/local/etc”]

This works great on our Linux boxes but we use thewrittenword.com’s SSH on our Solaris and HP-UX boxes. The key is in /etc/opt/TWWfsw/openssh47 and, of course, the version changes sometimes so it might be in /etc/opt/TWWfsw/openssh52, etc.

Thanks!

History

Updated by James Turnbull almost 2 years ago

  • Category set to library
  • Status changed from Unreviewed to Needs More Information

Is there a quick way to tell what the directory is? Can we just parse through anything starting with /etc/opt/TWWfsw/openssh?

Updated by Mark Plaksin almost 2 years ago

Here’s the fact we use to find the verison. It assumes you’re running the most recent version (of the versions installed), which we always are:

Facter.add("tww_ssh_version") do
    setcode do
        unless Dir.glob('/opt/TWWfsw/openssh*').empty?
            Dir.new('/opt/TWWfsw').find{|d| /openssh/.match(d)}.sort.last.delete('openssh')
        end
    end
end

Updated by Paul Nasrat over 1 year ago

Can you tell me the following:

Is sshd in root’s path? Does the following

sshd -T 2>/dev/null | grep hostkey | cut -d\ -f2

give the correct locations?

Updated by Mark Plaksin over 1 year ago

sshd isn’t in root’s PATH. Of course, it could be in root’s PATH but we tend to set it in our normal user .bashrc or in an alias for ‘su’.

Updated by Paul Nasrat over 1 year ago

Regardless of the path can you let me know if the sshd command line above gives you the correct locations for hostkeys:

sshd -T 2>/dev/null | grep hostkey | cut -d\ -f2

Updated by Mark Plaksin over 1 year ago

It looks like ‘-T’ is only available in 5.x which we don’t have everywhere yet (and it will be a while before we do).

Updated by Luke Kanies over 1 year ago

  • Subject changed from Path to ssh key to Path to ssh key should be configurable

Updated by Ken Barber 3 months ago

  • Target version set to 1.7.x

Updated by Adrien Thebo about 1 month ago

We can add another resolution that tries to use sshd -T and then fall back to hardcoded paths.

Also available in: Atom PDF