{"id":317,"date":"2026-04-28T14:18:02","date_gmt":"2026-04-28T06:18:02","guid":{"rendered":"https:\/\/blog.zeronely.cn\/?p=317"},"modified":"2026-04-28T14:18:03","modified_gmt":"2026-04-28T06:18:03","slug":"%e5%85%b3%e4%ba%8e%e9%83%a8%e5%88%86linux%e5%b8%b8%e7%94%a8%e6%8c%87%e4%bb%a4%e7%9a%84%e6%95%b4%e7%90%86","status":"publish","type":"post","link":"https:\/\/blog.zeronely.cn\/index.php\/2026\/04\/28\/%e5%85%b3%e4%ba%8e%e9%83%a8%e5%88%86linux%e5%b8%b8%e7%94%a8%e6%8c%87%e4%bb%a4%e7%9a%84%e6%95%b4%e7%90%86\/","title":{"rendered":"\u5173\u4e8e\u90e8\u5206linux\u5e38\u7528\u6307\u4ee4\u7684\u6574\u7406"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u7cfb\u7edf\u4e0e\u6587\u4ef6\u57fa\u7840\u6307\u4ee4<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u6307\u4ee4<\/th><th>\u8bf4\u660e<\/th><th>\u5e38\u7528\u793a\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>ls<\/code><\/td><td>\u5217\u51fa\u76ee\u5f55\u5185\u5bb9<\/td><td><code>ls -la<\/code> (\u663e\u793a\u9690\u85cf\u6587\u4ef6\u548c\u8be6\u60c5)<\/td><\/tr><tr><td><code>cd<\/code><\/td><td>\u5207\u6362\u76ee\u5f55<\/td><td><code>cd ~<\/code> (\u56de\u5230\u5bb6\u76ee\u5f55)<\/td><\/tr><tr><td><code>pwd<\/code><\/td><td>\u663e\u793a\u5f53\u524d\u8def\u5f84<\/td><td><code>pwd<\/code><\/td><\/tr><tr><td><code>cp<\/code><\/td><td>\u590d\u5236\u6587\u4ef6\/\u76ee\u5f55<\/td><td><code>cp -r dir1 dir2<\/code> (\u9012\u5f52\u590d\u5236\u76ee\u5f55)<\/td><\/tr><tr><td><code>mv<\/code><\/td><td>\u79fb\u52a8\u6216\u91cd\u547d\u540d<\/td><td><code>mv old.txt new.txt<\/code><\/td><\/tr><tr><td><code>rm<\/code><\/td><td>\u5220\u9664\u6587\u4ef6\/\u76ee\u5f55<\/td><td><code>rm -rf dir\/<\/code> (<strong>\u614e\u7528<\/strong>\uff0c\u5f3a\u5236\u9012\u5f52\u5220\u9664)<\/td><\/tr><tr><td><code>mkdir<\/code><\/td><td>\u521b\u5efa\u76ee\u5f55<\/td><td><code>mkdir -p path\/to\/dir<\/code> (\u9012\u5f52\u521b\u5efa)<\/td><\/tr><tr><td><code>touch<\/code><\/td><td>\u521b\u5efa\u7a7a\u6587\u4ef6\u6216\u66f4\u65b0\u65f6\u95f4\u6233<\/td><td><code>touch file.txt<\/code><\/td><\/tr><tr><td><code>cat<\/code><\/td><td>\u67e5\u770b\u6587\u4ef6\u5185\u5bb9<\/td><td><code>cat file.txt<\/code><\/td><\/tr><tr><td><code>less<\/code> \/ <code>more<\/code><\/td><td>\u5206\u9875\u67e5\u770b<\/td><td><code>less large.log<\/code><\/td><\/tr><tr><td><code>head<\/code> \/ <code>tail<\/code><\/td><td>\u67e5\u770b\u5f00\u5934\/\u7ed3\u5c3e<\/td><td><code>tail -f app.log<\/code> (\u5b9e\u65f6\u8ffd\u8e2a\u65e5\u5fd7)<\/td><\/tr><tr><td><code>grep<\/code><\/td><td>\u6587\u672c\u641c\u7d22<\/td><td><code>grep -r \"error\" \/var\/log\/<\/code><\/td><\/tr><tr><td><code>find<\/code><\/td><td>\u67e5\u627e\u6587\u4ef6<\/td><td><code>find \/ -name \"*.conf\"<\/code><\/td><\/tr><tr><td><code>chmod<\/code><\/td><td>\u4fee\u6539\u6743\u9650<\/td><td><code>chmod 755 script.sh<\/code><\/td><\/tr><tr><td><code>chown<\/code><\/td><td>\u4fee\u6539\u6240\u6709\u8005<\/td><td><code>chown user:group file<\/code><\/td><\/tr><tr><td><code>df<\/code><\/td><td>\u78c1\u76d8\u7a7a\u95f4<\/td><td><code>df -h<\/code> (\u4eba\u7c7b\u53ef\u8bfb\u683c\u5f0f)<\/td><\/tr><tr><td><code>du<\/code><\/td><td>\u76ee\u5f55\u5927\u5c0f<\/td><td><code>du -sh \/var\/log<\/code><\/td><\/tr><tr><td><code>ps<\/code><\/td><td>\u67e5\u770b\u8fdb\u7a0b<\/td><td><code>ps aux<\/code><\/td><\/tr><tr><td><code>top<\/code> \/ <code>htop<\/code><\/td><td>\u52a8\u6001\u8fdb\u7a0b\u76d1\u63a7<\/td><td><code>htop<\/code> (\u9700\u5b89\u88c5)<\/td><\/tr><tr><td><code>kill<\/code> \/ <code>killall<\/code><\/td><td>\u7ec8\u6b62\u8fdb\u7a0b<\/td><td><code>kill -9 PID<\/code><\/td><\/tr><tr><td><code>tar<\/code><\/td><td>\u6253\u5305\u538b\u7f29<\/td><td><code>tar -czvf backup.tar.gz dir\/<\/code><\/td><\/tr><tr><td><code>wget<\/code> \/ <code>curl<\/code><\/td><td>\u4e0b\u8f7d\u6587\u4ef6<\/td><td><code>curl -O http:\/\/example.com\/file<\/code><\/td><\/tr><tr><td><code>systemctl<\/code><\/td><td>\u670d\u52a1\u7ba1\u7406<\/td><td><code>systemctl restart nginx<\/code><\/td><\/tr><tr><td><code>journalctl<\/code><\/td><td>\u67e5\u770b\u7cfb\u7edf\u65e5\u5fd7<\/td><td><code>journalctl -u nginx -f<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001Screen \u2014 \u7ec8\u7aef\u4f1a\u8bdd\u7ba1\u7406<\/h2>\n\n\n\n<p>Screen \u53ef\u4ee5\u8ba9\u4f60\u5728 SSH \u65ad\u5f00\u540e\u4fdd\u6301\u7a0b\u5e8f\u7ee7\u7eed\u8fd0\u884c\uff0c\u6216\u5728\u5355\u4e2a\u7ec8\u7aef\u4e2d\u7ba1\u7406\u591a\u4e2a\u4f1a\u8bdd\u7a97\u53e3\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u57fa\u7840\u64cd\u4f5c<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u6307\u4ee4<\/th><th>\u8bf4\u660e<\/th><\/tr><\/thead><tbody><tr><td><code>screen -S name<\/code><\/td><td>\u521b\u5efa\u540d\u4e3a name \u7684\u65b0\u4f1a\u8bdd<\/td><\/tr><tr><td><code>screen -ls<\/code><\/td><td>\u5217\u51fa\u6240\u6709\u4f1a\u8bdd<\/td><\/tr><tr><td><code>screen -r name<\/code><\/td><td>\u6062\u590d(detached)\u7684\u4f1a\u8bdd<\/td><\/tr><tr><td><code>screen -d name<\/code><\/td><td>\u8fdc\u7a0b\u5206\u79bb(detach)\u67d0\u4e2a\u4f1a\u8bdd<\/td><\/tr><tr><td><code>screen -d -r name<\/code><\/td><td>\u5f3a\u5236\u5206\u79bb\u5e76\u6062\u590d\u4f1a\u8bdd<\/td><\/tr><tr><td><code>screen -X -S name quit<\/code><\/td><td>\u5f3a\u5236\u5173\u95ed\u67d0\u4e2a\u4f1a\u8bdd<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f1a\u8bdd\u5185\u5feb\u6377\u952e\uff08\u5148\u6309 <code>Ctrl+A<\/code>\uff0c\u518d\u6309\u4ee5\u4e0b\u952e\uff09<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u5feb\u6377\u952e<\/th><th>\u8bf4\u660e<\/th><\/tr><\/thead><tbody><tr><td><code>Ctrl+A<\/code> \u7136\u540e <code>D<\/code><\/td><td><strong>\u5206\u79bb\u5f53\u524d\u4f1a\u8bdd<\/strong>\uff08\u540e\u53f0\u8fd0\u884c\uff0c\u4e0d\u4e2d\u65ad\u7a0b\u5e8f\uff09<\/td><\/tr><tr><td><code>Ctrl+A<\/code> \u7136\u540e <code>C<\/code><\/td><td>\u5728\u5f53\u524d\u4f1a\u8bdd\u4e2d\u521b\u5efa\u65b0\u7a97\u53e3<\/td><\/tr><tr><td><code>Ctrl+A<\/code> \u7136\u540e <code>N<\/code><\/td><td>\u5207\u6362\u5230\u4e0b\u4e00\u4e2a\u7a97\u53e3<\/td><\/tr><tr><td><code>Ctrl+A<\/code> \u7136\u540e <code>P<\/code><\/td><td>\u5207\u6362\u5230\u4e0a\u4e00\u4e2a\u7a97\u53e3<\/td><\/tr><tr><td><code>Ctrl+A<\/code> \u7136\u540e <code>K<\/code><\/td><td>\u5173\u95ed\u5f53\u524d\u7a97\u53e3\uff08\u9700\u786e\u8ba4\uff09<\/td><\/tr><tr><td><code>Ctrl+A<\/code> \u7136\u540e <code>?<\/code><\/td><td>\u663e\u793a\u6240\u6709\u5feb\u6377\u952e\u5e2e\u52a9<\/td><\/tr><tr><td><code>Ctrl+A<\/code> \u7136\u540e <code>[<\/code><\/td><td>\u8fdb\u5165\u590d\u5236\/\u6eda\u52a8\u6a21\u5f0f\uff08\u6309 <code>Esc<\/code> \u9000\u51fa\uff09<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u7528\u793a\u4f8b<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># 1. \u521b\u5efa\u4e00\u4e2a\u540e\u53f0\u8fd0\u884c\u4efb\u52a1\nscreen -S myjob\npython train.py        # \u5728 screen \u4e2d\u8fd0\u884c\u957f\u65f6\u95f4\u4efb\u52a1\nCtrl+A, D              # \u5206\u79bb\u4f1a\u8bdd\uff0c\u4efb\u52a1\u5728\u540e\u53f0\u7ee7\u7eed\u8fd0\u884c\n\n# 2. \u7a0d\u540e\u6062\u590d\u67e5\u770b\u8fdb\u5ea6\nscreen -r myjob\n\n# 3. \u5f00\u673a\u81ea\u52a8\u542f\u52a8 screen \u4f1a\u8bdd\uff08\u53ef\u5199\u5165 crontab @reboot\uff09\n@reboot screen -dmS server bash -c 'cd \/app &amp;&amp; .\/start.sh'<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001Rsync \u2014 \u9ad8\u6548\u6587\u4ef6\u540c\u6b65<\/h2>\n\n\n\n<p>Rsync \u662f Linux \u4e0b\u6700\u5f3a\u5927\u7684\u6587\u4ef6\u540c\u6b65\u5de5\u5177\uff0c\u652f\u6301\u589e\u91cf\u4f20\u8f93\u3001\u538b\u7f29\u3001\u6392\u9664\u89c4\u5219\u7b49\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u57fa\u7840\u8bed\u6cd5<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync &#91;\u9009\u9879] \u6e90 \u76ee\u6807<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u5e38\u7528\u9009\u9879<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u9009\u9879<\/th><th>\u8bf4\u660e<\/th><\/tr><\/thead><tbody><tr><td><code>-a<\/code><\/td><td>\u5f52\u6863\u6a21\u5f0f\uff08\u4fdd\u7559\u6743\u9650\u3001\u65f6\u95f4\u6233\u3001\u7b26\u53f7\u94fe\u63a5\u7b49\uff0c\u76f8\u5f53\u4e8e <code>-rlptgoD<\/code>\uff09<\/td><\/tr><tr><td><code>-v<\/code><\/td><td>\u8be6\u7ec6\u8f93\u51fa<\/td><\/tr><tr><td><code>-z<\/code><\/td><td>\u4f20\u8f93\u65f6\u538b\u7f29<\/td><\/tr><tr><td><code>-P<\/code><\/td><td>\u663e\u793a\u8fdb\u5ea6\uff0c\u4e14\u652f\u6301\u65ad\u70b9\u7eed\u4f20\uff08\u7b49\u4e8e <code>--partial --progress<\/code>\uff09<\/td><\/tr><tr><td><code>--delete<\/code><\/td><td>\u5220\u9664\u76ee\u6807\u7aef\u6709\u4f46\u6e90\u7aef\u6ca1\u6709\u7684\u6587\u4ef6\uff08\u4fdd\u6301\u4e25\u683c\u4e00\u81f4\uff09<\/td><\/tr><tr><td><code>--exclude<\/code><\/td><td>\u6392\u9664\u7279\u5b9a\u6587\u4ef6\/\u76ee\u5f55<\/td><\/tr><tr><td><code>-e<\/code><\/td><td>\u6307\u5b9a\u8fdc\u7a0b shell\uff08\u5982 ssh\uff09<\/td><\/tr><tr><td><code>-n<\/code> \/ <code>--dry-run<\/code><\/td><td><strong>\u6a21\u62df\u8fd0\u884c<\/strong>\uff0c\u4e0d\u5b9e\u9645\u6267\u884c\uff0c\u5148\u67e5\u770b\u4f1a\u505a\u4ec0\u4e48<\/td><\/tr><tr><td><code>--progress<\/code><\/td><td>\u663e\u793a\u4f20\u8f93\u8fdb\u5ea6<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u672c\u5730\u540c\u6b65\u793a\u4f8b<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u57fa\u672c\u540c\u6b65\uff08\u6e90\u76ee\u5f55\u5185\u5bb9\u590d\u5236\u5230\u76ee\u6807\uff09\nrsync -av \/source\/dir\/ \/backup\/dir\/\n\n# \u6ce8\u610f\uff1a\u672b\u5c3e\u7684\u659c\u6760\u5f88\u91cd\u8981\uff01\n# \/source\/dir\/  \u2192 \u540c\u6b65\u76ee\u5f55\u4e0b\u7684\u5185\u5bb9\u5230\u76ee\u6807\n# \/source\/dir   \u2192 \u540c\u6b65\u6574\u4e2a\u76ee\u5f55\u5230\u76ee\u6807\u4e0b\uff08\u4f1a\u521b\u5efa dir \u5b50\u76ee\u5f55\uff09\n\n# \u589e\u91cf\u5907\u4efd\uff0c\u5220\u9664\u76ee\u6807\u7aef\u591a\u4f59\u6587\u4ef6\uff08\u955c\u50cf\u540c\u6b65\uff09\nrsync -av --delete \/source\/dir\/ \/backup\/dir\/\n\n# \u6392\u9664\u7279\u5b9a\u6587\u4ef6\nrsync -av --exclude='*.log' --exclude='temp\/' \/source\/ \/backup\/\n\n# \u4ece\u6587\u4ef6\u8bfb\u53d6\u6392\u9664\u89c4\u5219\nrsync -av --exclude-from='exclude.txt' \/source\/ \/backup\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u8fdc\u7a0b\u540c\u6b65\u793a\u4f8b<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u63a8\uff1a\u672c\u5730 \u2192 \u8fdc\u7a0b\nrsync -avz -e ssh \/local\/path\/ user@remote_host:\/remote\/path\/\n\n# \u62c9\uff1a\u8fdc\u7a0b \u2192 \u672c\u5730\nrsync -avz -e ssh user@remote_host:\/remote\/path\/ \/local\/path\/\n\n# \u4f7f\u7528\u975e\u9ed8\u8ba4 SSH \u7aef\u53e3\nrsync -avz -e \"ssh -p 2222\" \/local\/ user@host:\/remote\/\n\n# \u663e\u793a\u8fdb\u5ea6 + \u65ad\u70b9\u7eed\u4f20\uff08\u5927\u6587\u4ef6\u4f20\u8f93\u63a8\u8350\uff09\nrsync -avzP \/large-file.iso user@host:\/remote\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u91cd\u8981\u63d0\u793a<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5148\u7528 <code>--dry-run<\/code> \u6d4b\u8bd5<\/strong>\uff1a<code>rsync -avn --delete \/src\/ \/dest\/<\/code><\/li>\n\n\n\n<li><code>--delete<\/code> \u5f88\u5371\u9669\uff0c\u786e\u4fdd\u65b9\u5411\u6b63\u786e\uff0c\u5426\u5219\u4f1a\u8bef\u5220\u6570\u636e<\/li>\n\n\n\n<li>\u9002\u5408\u5b9a\u671f\u5907\u4efd\uff0c\u53ef\u914d\u5408 <code>cron<\/code> \u4f7f\u7528<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001SSH \u5bc6\u94a5\u8bbe\u7f6e<\/h2>\n\n\n\n<p>SSH \u5bc6\u94a5\u767b\u5f55\u6bd4\u5bc6\u7801\u66f4\u5b89\u5168\u3001\u66f4\u65b9\u4fbf\uff0c\u514d\u53bb\u6bcf\u6b21\u8f93\u5165\u5bc6\u7801\u7684\u9ebb\u70e6\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u751f\u6210\u5bc6\u94a5\u5bf9<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u751f\u6210 ED25519 \u5bc6\u94a5\uff08\u63a8\u8350\uff0c\u66f4\u5b89\u5168\u3001\u66f4\u77ed\uff09\nssh-keygen -t ed25519 -C \"your_email@example.com\"\n\n# \u6216\u751f\u6210 RSA \u5bc6\u94a5\uff08\u517c\u5bb9\u65e7\u7cfb\u7edf\uff09\nssh-keygen -t rsa -b 4096 -C \"your_email@example.com\"<\/code><\/pre>\n\n\n\n<p>\u6267\u884c\u540e\u4f1a\u63d0\u793a\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4fdd\u5b58\u8def\u5f84\uff1a\u9ed8\u8ba4 <code>~\/.ssh\/id_ed25519<\/code>\uff08\u76f4\u63a5\u56de\u8f66\uff09<\/li>\n\n\n\n<li>\u5bc6\u7801\u77ed\u8bed(passphrase)\uff1a\u5efa\u8bae\u8bbe\u7f6e\uff08\u4e5f\u53ef\u7559\u7a7a\u5b9e\u73b0\u65e0\u5bc6\u7801\u767b\u5f55\uff09<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u5c06\u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u65b9\u6cd5\u4e00\uff1a\u4f7f\u7528 ssh-copy-id\uff08\u63a8\u8350\uff0c\u81ea\u52a8\u914d\u7f6e\uff09\nssh-copy-id -i ~\/.ssh\/id_ed25519.pub user@remote_host\n\n# \u65b9\u6cd5\u4e8c\uff1a\u624b\u52a8\u590d\u5236\uff08\u5982\u679c ssh-copy-id \u4e0d\u53ef\u7528\uff09\ncat ~\/.ssh\/id_ed25519.pub | ssh user@remote_host \"mkdir -p ~\/.ssh &amp;&amp; cat &gt;&gt; ~\/.ssh\/authorized_keys &amp;&amp; chmod 600 ~\/.ssh\/authorized_keys\"<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u914d\u7f6e SSH \u5ba2\u6237\u7aef\uff08\u53ef\u9009\u4f46\u63a8\u8350\uff09<\/h3>\n\n\n\n<p>\u7f16\u8f91 <code>~\/.ssh\/config<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Host myserver\n    HostName 192.168.1.100\n    User admin\n    Port 2222\n    IdentityFile ~\/.ssh\/id_ed25519\n    ServerAliveInterval 60\n    ServerAliveCountMax 3<\/code><\/pre>\n\n\n\n<p>\u4e4b\u540e\u53ef\u76f4\u63a5\uff1a<code>ssh myserver<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. \u670d\u52a1\u5668\u7aef\u5b89\u5168\u52a0\u56fa\uff08\/etc\/ssh\/sshd_config\uff09<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\nsudo nano \/etc\/ssh\/sshd_config\n\n# \u4fee\u6539\u4ee5\u4e0b\u914d\u7f6e\nPermitRootLogin no          # \u7981\u6b62 root \u767b\u5f55\nPasswordAuthentication no   # \u7981\u7528\u5bc6\u7801\u767b\u5f55\uff08\u4ec5\u5bc6\u94a5\uff09\nPubkeyAuthentication yes    # \u542f\u7528\u5bc6\u94a5\u8ba4\u8bc1\n\n# \u91cd\u542f SSH \u670d\u52a1\nsudo systemctl restart sshd   # Debian\/Ubuntu\nsudo systemctl restart sshd   # CentOS\/RHEL (\u6216 ssh)<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u26a0\ufe0f <strong>\u8b66\u544a<\/strong>\uff1a\u7981\u7528\u5bc6\u7801\u767b\u5f55\u524d\uff0c\u52a1\u5fc5\u786e\u8ba4\u5bc6\u94a5\u80fd\u6b63\u5e38\u767b\u5f55\uff0c\u5426\u5219\u4f1a\u88ab\u9501\u5728\u670d\u52a1\u5668\u5916\uff01<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001SSH \u4f20\u8f93\u6587\u4ef6<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u65b9\u5f0f<\/th><th>\u9002\u7528\u573a\u666f<\/th><th>\u6307\u4ee4<\/th><\/tr><\/thead><tbody><tr><td><code>scp<\/code><\/td><td>\u7b80\u5355\u5355\u6587\u4ef6\/\u76ee\u5f55\u4f20\u8f93<\/td><td><code>scp file.txt user@host:\/path\/<\/code><\/td><\/tr><tr><td><code>rsync<\/code><\/td><td>\u5927\u6587\u4ef6\u3001\u589e\u91cf\u540c\u6b65\u3001\u65ad\u70b9\u7eed\u4f20<\/td><td><code>rsync -avzP file user@host:\/path\/<\/code><\/td><\/tr><tr><td><code>sftp<\/code><\/td><td>\u4ea4\u4e92\u5f0f\u6587\u4ef6\u7ba1\u7406<\/td><td><code>sftp user@host<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">SCP \u8be6\u7ec6\u7528\u6cd5<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u672c\u5730 \u2192 \u8fdc\u7a0b\nscp file.txt user@remote:\/home\/user\/\nscp -r \/local\/dir\/ user@remote:\/remote\/dir\/      # \u9012\u5f52\u590d\u5236\u76ee\u5f55\nscp -P 2222 file.txt user@remote:\/path\/          # \u6307\u5b9a\u7aef\u53e3\uff08\u6ce8\u610f\u662f\u5927\u5199 P\uff09\n\n# \u8fdc\u7a0b \u2192 \u672c\u5730\nscp user@remote:\/remote\/file.txt \/local\/path\/\nscp -r user@remote:\/remote\/dir\/ \/local\/path\/\n\n# \u8fdc\u7a0b \u2192 \u8fdc\u7a0b\uff08\u901a\u8fc7\u672c\u5730\u4e2d\u8f6c\uff09\nscp user1@host1:\/file.txt user2@host2:\/path\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">SFTP \u4ea4\u4e92\u5f0f\u7528\u6cd5<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sftp user@remote_host\n\n# \u8fdb\u5165\u540e\u5e38\u7528\u547d\u4ee4\uff1a\nsftp&gt; ls                    # \u5217\u51fa\u8fdc\u7a0b\u76ee\u5f55\nsftp&gt; lls                   # \u5217\u51fa\u672c\u5730\u76ee\u5f55\nsftp&gt; cd \/remote\/path       # \u5207\u6362\u8fdc\u7a0b\u76ee\u5f55\nsftp&gt; lcd \/local\/path       # \u5207\u6362\u672c\u5730\u76ee\u5f55\nsftp&gt; get remote.txt        # \u4e0b\u8f7d\u6587\u4ef6\nsftp&gt; get -r remote_dir\/    # \u4e0b\u8f7d\u76ee\u5f55\nsftp&gt; put local.txt         # \u4e0a\u4f20\u6587\u4ef6\nsftp&gt; put -r local_dir\/     # \u4e0a\u4f20\u76ee\u5f55\nsftp&gt; bye \/ exit \/ quit     # \u9000\u51fa<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001\u5feb\u901f\u5bf9\u7167\u8868<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u9700\u6c42<\/th><th>\u63a8\u8350\u5de5\u5177<\/th><th>\u539f\u56e0<\/th><\/tr><\/thead><tbody><tr><td>\u540e\u53f0\u8fd0\u884c\u7a0b\u5e8f\u9632\u65ad\u8fde<\/td><td><code>screen<\/code> \/ <code>tmux<\/code><\/td><td>\u4f1a\u8bdd\u6301\u4e45\u5316<\/td><\/tr><tr><td>\u5927\u6587\u4ef6\/\u76ee\u5f55\u540c\u6b65<\/td><td><code>rsync<\/code><\/td><td>\u589e\u91cf\u3001\u538b\u7f29\u3001\u65ad\u70b9\u7eed\u4f20<\/td><\/tr><tr><td>\u7b80\u5355\u5355\u6587\u4ef6\u590d\u5236<\/td><td><code>scp<\/code><\/td><td>\u8bed\u6cd5\u7b80\u5355\u76f4\u63a5<\/td><\/tr><tr><td>\u4ea4\u4e92\u5f0f\u6587\u4ef6\u7ba1\u7406<\/td><td><code>sftp<\/code><\/td><td>\u7c7b\u4f3c FTP \u7684\u64cd\u4f5c\u4f53\u9a8c<\/td><\/tr><tr><td>\u514d\u5bc6\u7801\u767b\u5f55\u670d\u52a1\u5668<\/td><td>SSH \u5bc6\u94a5<\/td><td>\u5b89\u5168\u4e14\u81ea\u52a8\u5316\u53cb\u597d<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u7cfb\u7edf\u4e0e\u6587\u4ef6\u57fa\u7840\u6307\u4ee4 \u6307\u4ee4 \u8bf4\u660e \u5e38\u7528\u793a\u4f8b ls \u5217\u51fa\u76ee\u5f55\u5185\u5bb9 ls -la (\u663e\u793a\u9690\u85cf\u6587\u4ef6\u548c\u8be6\u60c5) cd  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-317","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.zeronely.cn\/index.php\/wp-json\/wp\/v2\/posts\/317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zeronely.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zeronely.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zeronely.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zeronely.cn\/index.php\/wp-json\/wp\/v2\/comments?post=317"}],"version-history":[{"count":1,"href":"https:\/\/blog.zeronely.cn\/index.php\/wp-json\/wp\/v2\/posts\/317\/revisions"}],"predecessor-version":[{"id":318,"href":"https:\/\/blog.zeronely.cn\/index.php\/wp-json\/wp\/v2\/posts\/317\/revisions\/318"}],"wp:attachment":[{"href":"https:\/\/blog.zeronely.cn\/index.php\/wp-json\/wp\/v2\/media?parent=317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zeronely.cn\/index.php\/wp-json\/wp\/v2\/categories?post=317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zeronely.cn\/index.php\/wp-json\/wp\/v2\/tags?post=317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}