{"id":164095,"date":"2012-12-27T01:06:04","date_gmt":"2012-12-26T21:06:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=164095"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=164095","title":{"rendered":"<span class=\"post_title\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 mercurial-server over ssh \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 mercurial-server over ssh, \u043e\u0442 \u043d\u0443\u043b\u044f \u0434\u043e 100%.<\/p>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0442\u043e\u043f\u0438\u043a\u043e\u043c <a href=\"http:\/\/habrahabr.ru\/post\/140347\/\">aivus<\/a>, \u043d\u043e \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0435\u0433\u043e \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442.<\/p>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0431\u0443\u0434\u0443 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0434\u043b\u044f mercurial-server 1.3, fedora 16. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u043c \u0443 \u0432\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u043e\u0448\u0438\u0431\u043a\u0438, \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438 \u0441\u0443\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0448\u0430\u0442\u044c.<\/p>\n<h4>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h4>\n<p>  \u0421\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435  <\/p>\n<ul>\n<li>wget<\/li>\n<li>nano<\/li>\n<li>python<\/li>\n<li>mercuial<\/li>\n<\/ul>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 <\/h4>\n<p>  \u0414\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434 \u0440\u0443\u0442\u043e\u043c, \u043e\u0447\u0435\u043d\u044c \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e.<br \/>  \u041f\u043e\u043b\u0443\u0447\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438:  <\/p>\n<pre><code class=\"bash\">wget http:\/\/dev.lshift.net\/paul\/mercurial-server\/mercurial-server_1.3.tar.gz tar -xf mercurial-server_1.3.tar.gz cd mercurial-server-1.3 <\/code><\/pre>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c mercurial-server  <\/p>\n<pre><code class=\"bash\">python setup.py build python setup.py install <\/code><\/pre>\n<p>  \u042f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 \u043e\u0434\u043d\u043e \u043c\u0435\u0441\u0442\u043e.  <\/p>\n<pre><code class=\"bash\">cp scripts*\/* \/var\/lib\/mercurial-server\/ <\/code><\/pre>\n<p>  <\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 sshd<\/h4>\n<p>  \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443  <\/p>\n<pre><code class=\"bash\">nano \/etc\/ssh\/sshd_config  <\/code><\/pre>\n<p>  \u0420\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0438  <\/p>\n<pre><code class=\"bash\">RSAAuthentication yes PubkeyAuthentication yes <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0434\u0438\u043d\u044b\u0439 \u0446\u0435\u043d\u0442\u0440 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439  <\/p>\n<pre><code class=\"bash\">AuthorizedKeysFile \/etc\/ssh\/keys\/%u.pub <\/code><\/pre>\n<pre><code class=\"bash\">mkdir \/etc\/ssh\/keys <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0422\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439 \u0432 sshd<\/h4>\n<p>  \u0412\u0441\u0435 \u043a\u043b\u044e\u0447\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 mercurial-server \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443<br \/>  <i>\/etc\/mercurial-server\/keys\/<\/i> \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 refresh-auth(\u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f), \u0432\u0441\u0435 \u043a\u043b\u044e\u0447\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 <i>\/var\/lib\/mercurial-server\/.ssh\/authorized_keys<\/i><br \/>  \u0427\u0442\u043e \u0431\u044b sshd \u0441\u0442\u0430\u043b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u044d\u0442\u0438 \u043a\u043b\u044e\u0447\u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435  <\/p>\n<pre><code class=\"bash\">touch \/var\/lib\/mercurial-server\/.ssh\/authorized_keys chmod 644  \/var\/lib\/mercurial-server\/.ssh\/authorized_keys ln  \/var\/lib\/mercurial-server\/.ssh\/authorized_keys \/etc\/ssh\/keys\/hg.pub <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0417\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u0439 \u0448\u0442\u0440\u0438\u0445<\/h4>\n<p>  <u>\u042d\u0442\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 hgadmin!<\/u>  <\/p>\n<pre><code class=\"bash\">touch \/usr\/bin\/hg-update-users chmod 744 \/usr\/bin\/hg-update-users nano \/usr\/bin\/hg-update-users <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">chown hg -R \/etc\/mercurial-server\/keys\/ chmod 444 -R \/etc\/mercurial-server\/keys\/ sudo -u hg \/var\/lib\/mercurial-server\/refresh-auth <\/code><\/pre>\n<p>  <\/p>\n<h4>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/h4>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u044e\u0447 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 mercurial-server(\u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435)  <\/p>\n<pre><code class=\"bash\">ssh-keygen scp ~\/.ssh\/id_rsa.pub root@&lt;b&gt;\u0432\u0430\u0448_\u0441\u0435\u0440\u0432\u0435\u0440&lt;\/b&gt;:\/etc\/mercurial-server\/keys\/root\/ ssh root@&lt;b&gt;\u0432\u0430\u0448_\u0441\u0435\u0440\u0432\u0435\u0440&lt;\/b&gt; 'hg-update-users' <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u0439 \u0448\u0442\u0440\u0438\u0445, \u0437\u0430\u0439\u0434\u0438\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 ssh \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f:  <\/p>\n<pre><code class=\"bash\">$ ssh hg@&lt;b&gt;\u0432\u0430\u0448_\u0441\u0435\u0440\u0432\u0435\u0440&lt;\/b&gt; PTY allocation request failed on channel 0 &lt;u&gt;mercurial-server: direct logins on the hg account prohibited&lt;\/u&gt; Connection to &lt;b&gt;\u0432\u0430\u0448_\u0441\u0435\u0440\u0432\u0435\u0440&lt;\/b&gt; closed. <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438, \u0437\u043d\u0430\u0447\u0438\u0442 sshd \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0430\u0448\u0438 \u043a\u043b\u044e\u0447\u0438, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435:  <\/p>\n<pre><code class=\"bash\">ssh hg@&lt;b&gt;\u0432\u0430\u0448_\u0441\u0435\u0440\u0432\u0435\u0440&lt;\/b&gt; 'hg -R hgadmin serve --stdio' <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 30 \u0441\u0435\u043a\u0443\u043d\u0434 \u0432\u044b \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u0437\u043d\u0430\u0447\u0438\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e, \u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440.  <\/p>\n<h4>\u0423\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n<p>  \u0414\u043b\u044f \u043c\u0435\u043d\u044f \u0441\u0430\u043c\u043e\u0439 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0430\u0440\u0435\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439(\u0438\u0437 \u0442\u0440\u0435\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a: ubuntu 10.04 server, linux mint 12, fedora 16) \u0431\u044b\u043b\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<pre><code class=\"bash\">$ssh hg@&lt;b&gt;\u0432\u0430\u0448_\u0441\u0435\u0440\u0432\u0435\u0440&lt;\/b&gt; 'hg -R hgadmin serve --stdio' Traceback (most recent call last):   File &quot;\/var\/lib\/mercurial-server\/hg-ssh&quot;, line 86, in &lt;module&gt;     dispatch.dispatch(['-R', repo, 'serve', '--stdio'])   File &quot;\/usr\/lib64\/python2.7\/site-packages\/mercurial\/dispatch.py&quot;, line 31, in dispatch     if req.ferr: AttributeError: 'list' object has no attribute 'ferr' <\/code><\/pre>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"http:\/\/stackoverflow.com\/questions\/6730735\/troubles-with-mercurial-1-9-and-ssh\">stackoverflow.com\/questions\/6730735\/troubles-with-mercurial-1-9-and-ssh<\/a><br \/>  \u041e\u0441\u043e\u0431\u043e \u043b\u0435\u043d\u0438\u0432\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0430\u0442\u0447\u0435\u043c (patch hg-ssh patch_file):  <\/p>\n<pre><code class=\"bash\">--- hg-ssh_old\t2012-12-27 00:49:04.764989364 +0300 +++ hg-ssh\t2012-12-27 00:50:16.173113572 +0300 @@ -83,7 +83,7 @@      repo = getrepo(&quot;read&quot;, cmd[6:-14])      if not os.path.isdir(repo + &quot;\/.hg&quot;):          fail(&quot;no such repository %s&quot; % repo) -    dispatch.dispatch(['-R', repo, 'serve', '--stdio']) +    dispatch.dispatch(dispatch.request(['-R', repo, 'serve', '--stdio']))  elif cmd.startswith('hg init '):      repo = getrepo(&quot;init&quot;, cmd[8:])      if os.path.exists(repo): @@ -91,7 +91,7 @@      d = os.path.dirname(repo)      if d != &quot;&quot; and not os.path.isdir(d):          os.makedirs(d) -    dispatch.dispatch(['init', repo]) +    dispatch.dispatch(dispatch.request(['init', repo]))  else:      fail(&quot;illegal command %r&quot; % cmd) <\/code><\/pre>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/164095\/\"> http:\/\/habrahabr.ru\/post\/164095\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 mercurial-server over ssh, \u043e\u0442 \u043d\u0443\u043b\u044f \u0434\u043e 100%.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-164095","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/164095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=164095"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/164095\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=164095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=164095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=164095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}