{"id":397418,"date":"2021-03-24T06:00:50","date_gmt":"2021-03-23T22:00:50","guid":{"rendered":"http:\/\/4563.org\/?p=397418"},"modified":"2021-03-24T06:00:50","modified_gmt":"2021-03-23T22:00:50","slug":"%e5%85%b3%e4%ba%8e-debian-%e7%9a%84-ssh-%e5%af%86%e9%92%a5%e7%ae%a1%e7%90%86%e5%99%a8%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=397418","title":{"rendered":"\u5173\u4e8e Debian \u7684 SSH \u5bc6\u94a5\u7ba1\u7406\u5668\u7684\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5173\u4e8e Debian \u7684 SSH \u5bc6\u94a5\u7ba1\u7406\u5668\u7684\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : joeyv2 <\/span>  <span><i><\/i> 1<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4f7f\u7528 crontab \u6765\u5b9a\u65f6\u6267\u884c.sh \u628a\u6587\u4ef6\u5907\u4efd\u5230 github\uff0c\u4f1a\u51fa\u73b0\u6709\u65f6\u9700\u8981\u624b\u52a8\u6267\u884c\u4e00\u6b21\u201cssh-agent bash\u201d\u5728\u6267\u884c.sh \u624d\u6210\u529f\uff0c\u6709\u65f6\u5c31\u4e0d\u7528\uff0c\u4ee5\u4e0b\u662f\u9519\u8bef\u5185\u5bb9\u548c.sh \u6e90\u7801 ###\u62a5\u9519\u5185\u5bb9\uff1a<\/p>\n<pre><code>Could not open a connection to your authentication agent. [email&#160;protected]: Permission denied (publickey). fatal: Could not read from remote repository.  Please make sure you have the correct access rights and the repository exists. <\/code><\/pre>\n<p>###.sh \u6587\u4ef6\u5185\u5bb9<\/p>\n<pre><code>#!\/bin\/bash cd \/root\/mc\/worlds git add -A git commit -m \"backup\" ssh-add \/root\/github git push -u origin master <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>9<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5545751\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Showfom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             = = \u5f88\u5c11\u542c\u8bf4\u5907\u4efd\u5230 github \u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5545752\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : joeyv2 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Showfom \u4e3b\u8981\u8fd8\u662f SSH \u5bc6\u94a5\u7ba1\u7406\u5668\u4e0d\u5de5\u4f5c\u4e86\uff0c\u9700\u8981\u624b\u52a8\u542f\u52a8\u3002sh \u6587\u4ef6\u6267\u884c ssh-agent bash \u6709\u6ca1\u53cd\u5e94\u3002\u5907\u4efd\u5730\u70b9\u7528 gitee \u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5545753\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dzdh <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6ca1\u770b\u61c2<\/p>\n<p>\u96be\u9053\u4e0d\u662f ~\/$USER\/.ssh\/config \u914d\u7f6e\u597d\u7136\u540e\u76f4\u63a5 sudo -u $USER git -C $path push \u4e48                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5545754\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : joeyv2 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @dzdh \u8fd8\u771f\u4e48\u8bd5\u8fc7\uff0c<br \/>\u6211\u662f\u6267\u884c<br \/>ssh-agent bash<br \/>ssh-add \/root\/github \u52a0\u8f7d\u5bc6\u94a5\u518d\u6267\u884c git \u6307\u4ee4\uff0c\u56e0\u4e3a\u4ed3\u5e93\u662f\u79c1\u6709\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5545755\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Showfom <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @joeyv2 git \u8bbe\u8ba1\u51fa\u6765\u5c31\u4e0d\u662f\u7ed9\u5907\u4efd\u7528\u7684\uff0c\u5907\u4efd\u8fd8\u662f\u63a8\u8350 s3 \u4e4b\u7c7b\u7684\u670d\u52a1                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5545756\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : joeyv2 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Showfom \u5c31\u662f\u770b\u4e2d\u5b83\u7684\u7248\u672c\u63a7\u5236\uff0c\u662f\u4e9a\u9a6c\u900a s3 \uff1f\u8fd8\u771f\u6ca1\u7528\u8fc7                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5545757\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dzdh <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @joeyv2 \u56fd\u5185\u5c31\u662f aliyun oss 100%\u517c\u5bb9 S3 \u534f\u8bae\u3002\u63a7\u5236\u53f0\u53ef\u4ee5\u5f00\u542f\u6587\u4ef6\u7248\u672c\u63a7\u5236\u3002\u53ef\u4ee5\u6302\u8f7d\u6210\u672c\u5730\u76d8\u7684\u5f62\u5f0f\u76f4\u63a5\u5728\u670d\u52a1\u5668\u4e0a\u8fdb\u884c\u8bfb\u5199\u65e0\u9700\u4efb\u4f55\u5176\u4ed6\u64cd\u4f5c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5545758\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : python4 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u90a3\u5c31\u628a ssh-agent \u547d\u4ee4\u52a0\u5230 shell \u91cc\u4e0d\u884c\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5545759\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : joeyv2 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @python4 \u628a ssh-agent bash \u52a0\u5165\u540e\uff0c\u6bcf\u6b21\u8fd0\u884c\u5230\u8fd9\u6761\u547d\u4ee4\u5c31\u8df3\u51fa\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8e Debian \u7684 SSH \u5bc6&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/397418"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=397418"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/397418\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=397418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=397418"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=397418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}