{"id":760,"date":"2017-08-23T21:56:14","date_gmt":"2017-08-23T18:56:14","guid":{"rendered":"https:\/\/helia.ee\/koolitus\/?page_id=760"},"modified":"2017-08-23T21:56:14","modified_gmt":"2017-08-23T18:56:14","slug":"ssh-kasutaja-ja-parooli-lisamise-script","status":"publish","type":"page","link":"https:\/\/helia.ee\/koolitus\/?page_id=760","title":{"rendered":"SSH kasutaja ja parooli lisamise script"},"content":{"rendered":"<pre class=\"lang-bsh prettyprint prettyprinted\"><code><span class=\"com\">#!\/bin\/bash<\/span>\r\n<span class=\"com\">#<\/span><span class=\"pln\">\r\nusername<\/span><span class=\"pun\">=<\/span><span class=\"str\">\"$1\"<\/span><span class=\"pln\">\r\npass<\/span><span class=\"pun\">=<\/span><span class=\"str\">\"$2\"<\/span><span class=\"pln\">\r\nshift <\/span><span class=\"lit\">2<\/span><span class=\"pln\">\r\nfname<\/span><span class=\"pun\">=<\/span><span class=\"str\">\"$*\"<\/span><span class=\"pln\">\r\n\r\nuseradd <\/span><span class=\"pun\">-<\/span><span class=\"pln\">m <\/span><span class=\"pun\">-<\/span><span class=\"pln\">s <\/span><span class=\"pun\">\/<\/span><span class=\"pln\">bin<\/span><span class=\"pun\">\/<\/span><span class=\"pln\">bash <\/span><span class=\"pun\">-<\/span><span class=\"pln\">c <\/span><span class=\"str\">\"$fname\"<\/span> <span class=\"str\">\"$username\"<\/span><span class=\"pln\">\r\necho <\/span><span class=\"str\">\"$username:$pass\"<\/span> <span class=\"pun\">|<\/span><span class=\"pln\"> chpasswd<\/span><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#!\/bin\/bash # username=&#8221;$1&#8243; pass=&#8221;$2&#8243; shift 2 fname=&#8221;$*&#8221; useradd -m -s \/bin\/bash -c &#8220;$fname&#8221; &#8220;$username&#8221; echo &#8220;$username:$pass&#8221; | chpasswd<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":707,"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-760","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/760","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=760"}],"version-history":[{"count":1,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/760\/revisions"}],"predecessor-version":[{"id":761,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/760\/revisions\/761"}],"up":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/707"}],"wp:attachment":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}