aker-gateway / Aker

SSH bastion/jump host/jumpserver
Other
567 stars 81 forks source link

Hosts.json not using "name" tag? #37

Closed Ramshield closed 7 years ago

Ramshield commented 7 years ago

Hi @anazmy. I figured a way to implement it to our needs and it works fine. I have just one small issue. My hosts.json file:

                            {
                    "name":"test.hostname.com",
                    "username":"root",
                    "hostname":"123.123.123.123",
                    "port":"22",
                    "key":"~/.ssh/id_rsa",
                    "groups":[
                            "Test"
                    ]
            },

But for some reason the "name" isn't working and it only shows the hostname. Does it use the "hostname" in the /etc/hosts/ file or the DNS record for hostname? As not all of our servers have a DNS record this might be an issue.

EDIT: code formatting wasn't working with GIT, so pasting it as plain text.

Ramshield commented 7 years ago

Also, "port" field isn't working when using another port?

anazmy commented 7 years ago

Hey @Ramshield , yes the "hostname" field is the one that shows on the user TUI screen, if you use a FQDN in the hostname field then you will need to ensure that DNS resolution works or alternatively add it in /etc/hosts , for large scale deployment its better of course to have a centralized DNS .

As for "port" filed , as of now it works with default ssh port 22 only .

Ramshield commented 7 years ago

Hi @anazmy. You might add that it uses /etc/hosts to the readme to make it more clear :)

You're working on using custom SSH ports?

anazmy commented 7 years ago

Well its not using /etc/hosts specifically , that depends on your nsswitch configuration so it can be served by a normal DNS server or via /etc/hosts, that's outside the scope of the project itself .

As for custom SSH port, I created issue #38 to track this request , I will try to include it in a future release .