Giter Site home page Giter Site logo

fossabot / radcli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from martencassel/radcli

0.0 1.0 0.0 647 KB

The radcli library provides a Ruby interface for performing actions on a Active Directory domain using the realmd/adcli tool library (https://www.freedesktop.org/software/realmd/adcli/).

License: Artistic License 2.0

Ruby 24.79% C 71.96% Shell 1.09% Dockerfile 2.16%

radcli's Introduction

Description

FOSSA Status

The radcli library provides a Ruby interface for performing actions on a Active Directory domain using the realmd/adcli tool. (adcli: https://www.freedesktop.org/software/realmd/adcli/devel-building.html)

Installation

This library is available as a gem.

Ubuntu 16.04

sudo apt-get -y install make gcc libkrb5-dev libldap2-dev libsasl2-dev
sudo gem install radcli

Redhat Linux 7.4

sudo yum -y install make gcc automake autoconf krb5-devel openldap-devel cyrus-sasl-devel cyrus-sasl-gssapi
sudo gem install radcli

Building

Ubuntu 16.04

sudo apt-get install ruby gem ruby-dev
sudo gem install rake bundler rake-compiler rspec
sudo apt-get install make gcc automake autoconf xmlto xsltproc libkrb5-dev libldap2-dev libsasl2-dev
git clone https://github.com/martencassel/radcli
cd radcli
rake build
gem install pkg/radcli-1.1.0.gem

Redhat Linux 7.4

sudo subscription-manager repos --enable rhel-7-server-optional-rpms
sudo yum -y install ruby gem ruby-devel
sudo yum -y install git make gcc automake autoconf krb5-devel openldap-devel cyrus-sasl-devel cyrus-sasl-gssapi
sudo gem install rake bundler rake-compiler rspec
git clone https://github.com/martencassel/radcli
cd radcli
rake build
gem install pkg/radcli-1.1.0.gem

Synposis

Connect using username/password

require 'radcli'

adconn = Adcli::AdConn.new("example.com")
adconn.set_domain_realm("EXAMPLE.COM")
adconn.set_domain_controller("dc.example.com")

adconn.set_login_user("Administrator")
adconn.set_user_password("password")

res = adconn.connect

or connect using local credentials cache

require 'radcli'
require "rkerberos"

# Kinit using principal name and keytab.
principal = "Administrator"
keytab file over an unsecured network.
keytab="/etc/foreman-proxy/ad.keytab"
krb5 = Kerberos::Krb5.new
ccache = Kerberos::Krb5::CredentialsCache.new
krb5.get_init_creds_keytab principal, keytab, nil, ccache

# Connect

adconn = Adcli::AdConn.new("example.com")
adconn.set_domain_realm("EXAMPLE.COM")
adconn.set_domain_controller("dc.example.com")

adconn.set_login_ccache_name("")

res = adconn.connect

Join

enroll = Adcli::AdEnroll.new(adconn)
enroll.set_computer_name("server")
enroll.set_host_fqdn("server.example.com")
enroll.set_computer_password("password")

enroll.join()

Reset Password

enroll = Adcli::AdEnroll.new(adconn)
enroll.set_computer_name("server")
enroll.set_computer_password("newpass")

enroll.password()

Delete

enroll = Adcli::AdEnroll.new(adconn)
enroll.set_computer_name("server")

enroll.delete()

Notes

For a testing environment you need the following:

  • A windows domain controller and a connected linux server.
  • The linux server must be able to resolve domain names from the domains dns server.

Authors

  • Mårten Cassel

License

FOSSA Status

radcli's People

Contributors

ananace avatar ekohl avatar fossabot avatar helge000 avatar martencassel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.