{"id":117,"date":"2008-04-08T23:32:07","date_gmt":"2008-04-08T23:32:07","guid":{"rendered":"http:\/\/patchlog.com\/?p=117"},"modified":"2008-04-03T23:42:17","modified_gmt":"2008-04-03T23:42:17","slug":"webmin-pptp-user-synchronization","status":"publish","type":"post","link":"https:\/\/patchlog.com\/webmin\/webmin-pptp-user-synchronization\/","title":{"rendered":"Webmin pptp user synchronization"},"content":{"rendered":"<p>Webmin has this great feature that it can add users in several modules when a system user is added ( of course only when added from webmin ).<\/p>\n<p>This feature can really be useful if you want for example to automatically add a system user to samba, mysql or other modules.<\/p>\n<p>In order for this to work each modules that wants such a synchronization had to implement some standard functions and put them in a special file inside their module directory. Then when a system user is added, removed or updated the Useradmin module will look for a file named useradmin_update.pl in all modules installed in webmin. When it finds the file it will execute a function in the useradmin_update.pl corresponding to the action  in useradmin module.<\/p>\n<p>The pptp-server is a webmin module that is used for administrating a  Point to Point Tunneling Protocol  server , an easy way for creating VPNs to be used by windows or Linux machines.  What I wanted was that when I added a system user webmin would also create a samba user and a pptp user so that the user could access the files over ftp or samba but over a more secure link so I wrote an useradmin_update.pl script for pptp<\/p>\n<h3>How to set it up?<\/h3>\n<p>get  the script: <a href=\"http:\/\/patchlog.com\/wp-content\/uploads\/2008\/04\/useradmin_update.pl\" title=\"script used for system to pptp user sync\" >useradmin_update.pl<\/a> and place it into you pptp-server module folder on gentoo this is \/usr\/libexec\/webmin\/pptp-server a simple locate pptp-server should show you where it is.<\/p>\n<p>Make sure you chmod 755 useradmin_update.pl<\/p>\n<p>add the following lines to config.info in pptp-server :<\/p>\n<pre>sync_add=Add a pptp vpn server user when a Unix user is added,1,1-Yes,0-No\r\nsync_change=Change the pptp vpn server user when a Unix user is changed,1,1-Yes,0-No\r\nsync_delete=Delete the pptp vpn server user when a Unix user is deleted,1,1-Yes,0-No<\/pre>\n<p>remove the module.infos.cache file ( usually \/etc\/webmin\/module.infos.cache )  and then restart webmin.<br \/>\nNow login to webmin as admin or root and go to Networking -&gt; PPTP VPN Server -&gt; Module config and check those 3 sync options .<\/p>\n<p>To test it add a user using the webmin-&gt; System -&gt; Users and Groups admin then go to Webmin -&gt; Networking -&gt; PPTP VPN Server -&gt; PPP Accounts and you should see the user there.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Webmin has this great feature that it can add users in several modules when a system user is added ( of course only when added from webmin ). This feature can really be useful if you want for example to automatically add a system user to samba, mysql or other modules. In order for this &hellip; <a href=\"https:\/\/patchlog.com\/webmin\/webmin-pptp-user-synchronization\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Webmin pptp user synchronization<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[153,156,155,154,353],"class_list":["post-117","post","type-post","status-publish","format-standard","hentry","category-webmin","tag-pptp","tag-sync","tag-useradmin","tag-vpn","tag-webmin"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pofPh-1T","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/posts\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/comments?post=117"}],"version-history":[{"count":0,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/posts\/117\/revisions"}],"wp:attachment":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/media?parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/categories?post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/tags?post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}