aker-gateway / Aker

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

newbee:Need Assist to set up Aker #78

Open hariharry opened 6 years ago

hariharry commented 6 years ago

lets say I have 3 servers in Server A is my aker gateway server.And two other servers Host A and Host B. I need to know about the host.json file 1.Do we have to create host groups, user groups, users Prior to that.Where do we have to create all this? 2.where do we have to create the Key file(id_rsa).in the hosts(A & B) or Server A I have gone through this https://www.kitploit.com/2018/06/aker-ssh-bastionjump-hostjumpserver.html?m=1 and arises a lot of questions.Can any one help me to set-up aker in my servers. OR create explained step by step procedure of the Set-up process.Because there isn't much documentation or videos regarding this installation and setup.

anazmy commented 6 years ago

Hi @hariharry

Currently, there are two modes for providing list of users/hosts.

First, use FreeIPA as your identity provider, this will provide you with a nice WebUI to handle your users.

Second mode, using a local hosts.json file containing list of users/hosts, here is a sample file. You can follow the same formatting to add your files.

Also there is an Ansible playbook that helps you setup the whole environment, please check the details here.

Let me know if this info helps.

hariharry commented 6 years ago

Yeah i have seen those json files.I have some doubts in that.the files should be in aker server right? where do we have to create the user groups,users,host groups and what keyfile is mentioned there? are we creating those keyfiles in the localhost and sharing the .pub in the Server A(aker) location ~/.ssh/ ? i know most of my questions may seem stupid but please be patient Thanks

hariharry commented 6 years ago

Hi I managed to do till here image

But there is no hosts

`{ "users": [{ "username": "user", "keyfile": "~/.ssh/local.pub"

            },
            {
                    "username": "jsmith",
                    "keyfile": "~/.ssh/new-sg.pem"
            }
    ],
    "hosts": [{
                    "name": "example",
                    "hostname": "ip-172-31-2-54.ap-south-1.compute.internal",
                    "port": "22",
                    "key": "~/.ssh/new.pem",
                    "username": "user",
                    "hostgroups": [
                            "linuxservers"
                    ]
            },
            {
                    "name": "web2.ipa.example",
                    "hostname": "web2.ipa.example",
                    "port": "22",
                    "key": "~/.ssh/id_rsa",
                    "hostgroups": [
                            "linuxservers"
                    ]
            }
    ]

} `

the first USER User is my localhost user and local.pub is the key i generated using ssh-keygen from my local host then i copied the local.pub to aker server(Server A) ~/.ssh/ location. second user is dummy user that username is doesn't exist. for HOSTs i created a server and copied that server pem key to ~/.ssh/ location of Server A (aker server) what else do i have to do to see the hosts in there.

Ramshield commented 5 years ago

Hi,

The only users you have setup are 'user' and 'jsmith'. However according to your print screen you're logged in as 'ec2-user', which doesn't match either given in the hosts.json file, hence none show up.

Add the user 'ec2-user' to hosts.json and it should work!