{"id":1296,"date":"2019-04-25T11:15:29","date_gmt":"2019-04-25T08:15:29","guid":{"rendered":"https:\/\/helia.ee\/koolitus\/?page_id=1296"},"modified":"2019-04-28T03:13:56","modified_gmt":"2019-04-28T00:13:56","slug":"debian-google-apps-password-sync-for-samba4","status":"publish","type":"page","link":"https:\/\/helia.ee\/koolitus\/?page_id=1296","title":{"rendered":"Google Apps Password Sync for Samba4"},"content":{"rendered":"\n<p>Reads from your Samba4 AD and updates passwords in Google Apps Note that this solution requires you to enable &#8220;password hash userPassword schemes = CryptSHA256 CryptSHA512&#8221; in smb.conf<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/baboons\/samba4-gaps#python-dependencies\"><\/a>Python Dependencies<\/h1>\n\n\n\n<ul class=\"wp-block-list\"><li>daemon<\/li><li>gdata<\/li><li>hashlib<\/li><li>syslog<\/li><li>samba<\/li><li>google api python client<\/li><\/ul>\n\n\n\n<p>Google API must be installed with pip: pip install &#8211;upgrade google-api-python-client<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/baboons\/samba4-gaps#install-notes\"><\/a>Install notes<\/h1>\n\n\n\n<ol class=\"wp-block-list\"><li>Install python-pip and python-openssl<\/li><li>Create a project in Google API Console and add Admin SDK permission (read\/write)<\/li><li>Create a JSON Config for your project in Google Developer Console<\/li><li>Install the JSON config to your samba machine in \/etc\/gaps\/service.json (create the folder if missing)<\/li><li>Copy gaps.py and gapslib.py to desired locations.<\/li><li>Copy gaps.conf to \/etc\/gaps\/gaps.conf and configure it<\/li><li>Run gaps.py in cron or at startup from rc.local, or both (if you wan&#8217;t to schedule a restart). Change your settings in gapslib.py to fit your setup.<\/li><li>Change syslog to desired local and add it to your syslog config for custom log file<\/li><li>Start the daemon and watch log file for updates<\/li><\/ol>\n\n\n\n<ul class=\"wp-block-list\"><li>If you are having trouble loading samba python modules please copy or symlink files and dirs in &#8220;\/usr\/local\/samba\/lib\/python2.7\/site-packages\/&#8221; to &#8220;\/usr\/lib\/python2.7\/&#8221;<\/li><li>If you are having issues with Google Permissions &#8211; you might need to add domain-wide authority to your service Delegate domain-wide authority to your service account&nbsp;<a href=\"https:\/\/developers.google.com\/drive\/web\/delegation#delegate_domain-wide_authority_to_your_service_account\">https:\/\/developers.google.com\/drive\/web\/delegation#delegate_domain-wide_authority_to_your_service_account<\/a><\/li><\/ul>\n\n\n\n<h1 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/baboons\/samba4-gaps#debug\"><\/a>Debug<\/h1>\n\n\n\n<p>If the daemon don&#8217;t start change \/dev\/null to \/dev\/tty in gaps.py and watch for error messages.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/baboons\/samba4-gaps#migration-from-old-google-provision-api-to-new-google-admin-sdk\"><\/a>Migration from old Google Provision API to new Google Admin SDK<\/h1>\n\n\n\n<ol class=\"wp-block-list\"><li>Install python-pip<\/li><li>Create a project in Google Developer Console and ad Admin SDK permission<\/li><li>Create a JSON config for you project in Google Developer Console<\/li><li>Download the json config from the Google Developer Console to your samba machine<\/li><li>pip install &#8211;upgrade google-api-python-client<\/li><li>Copy your settings from your local version of gapslib.py to the new config file \/etc\/gaps\/gaps.conf (create the fold if missing)<\/li><li>Replace gapslib.py with the new one<\/li><\/ol>\n\n\n\n<p>Failid:<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reads from your Samba4 AD and updates passwords in Google Apps Note that this solution requires you to enable &#8220;password hash userPassword schemes = CryptSHA256 CryptSHA512&#8221; in smb.conf Python Dependencies daemon gdata hashlib syslog samba google api python client Google API must be installed with pip: pip install &#8211;upgrade google-api-python-client Install notes Install python-pip and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1285,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-1296","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/1296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1296"}],"version-history":[{"count":2,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/1296\/revisions"}],"predecessor-version":[{"id":1301,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/1296\/revisions\/1301"}],"up":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/1285"}],"wp:attachment":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}