Hey there! I'm looking to read an SSH config file and get a list of the hosts in it. Such a config file is shown below:
Host testing1 test-hosts
HostName x.x.x.x
User ubuntu
# ... there is often more
Host testing2 test-hosts
HostName y.y.y.y
User jeffrey
IdentityFile ~/.ssh/identities/testing2
I've already read the contents of the file into an std::string and I'm looping over the lines, but what do I do next? I need the data in a struct like the following:
struct Host {
std::string name;
std::string group;
std::string user;
};
I'm using CMake so it is preferred that any libraries are CMake compatible π
Any help is appreciated!