{"id":67162,"date":"2015-03-22T11:17:10","date_gmt":"2015-03-22T03:17:10","guid":{"rendered":"http:\/\/www.xiaoyebailong.com\/?p=67162"},"modified":"2015-03-22T11:17:10","modified_gmt":"2015-03-22T03:17:10","slug":"25%e4%b8%aa%e5%bf%85%e9%a1%bb%e8%ae%b0%e4%bd%8f%e7%9a%84ssh%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2015\/03\/22\/67162.htm","title":{"rendered":"25\u4e2a\u5fc5\u987b\u8bb0\u4f4f\u7684SSH\u547d\u4ee4"},"content":{"rendered":"<p>OpenSSH\u662fSSH\u8fde\u63a5\u5de5\u5177\u7684\u514d\u8d39\u7248\u672c\u3002telnet\uff0crlogin\u548cftp\u7528\u6237\u53ef\u80fd\u8fd8\u6ca1\u610f\u8bc6\u5230\u4ed6\u4eec\u5728\u4e92\u8054\u7f51\u4e0a\u4f20\u8f93\u7684\u5bc6\u7801\u662f\u672a\u52a0\u5bc6\u7684\uff0c\u4f46SSH\u662f\u52a0\u5bc6\u7684\uff0cOpenSSH\u52a0\u5bc6\u6240\u6709\u901a\u4fe1\uff08\u5305\u62ec\u5bc6\u7801\uff09\uff0c\u6709\u6548\u6d88\u9664\u4e86\u7a83\u542c\uff0c\u8fde\u63a5\u52ab\u6301\u548c\u5176\u5b83\u653b\u51fb\u3002\u6b64\u5916\uff0cOpenSSH\u63d0\u4f9b\u4e86\u5b89\u5168\u96a7\u9053\u529f\u80fd\u548c\u591a\u79cd\u8eab\u4efd\u9a8c\u8bc1\u65b9\u6cd5\uff0c\u652f\u6301SSH\u534f\u8bae\u7684\u6240\u6709\u7248\u672c\u3002<\/p>\n<p>SSH\u662f\u4e00\u4e2a\u975e\u5e38\u4f1f\u5927\u7684\u5de5\u5177\uff0c\u5982\u679c\u4f60\u8981\u5728\u4e92\u8054\u7f51\u4e0a\u8fdc\u7a0b\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff0c\u90a3\u4e48SSH\u65e0\u7591\u662f\u6700\u4f73\u7684\u5019\u9009\u3002\u4e0b\u9762\u662f\u901a\u8fc7\u7f51\u7edc\u6295\u7968\u9009\u51fa\u768425\u4e2a\u6700\u4f73SSH\u547d\u4ee4\uff0c\u4f60\u5fc5\u987b\u7262\u8bb0\u4e8e\u5fc3\u3002<\/p>\n<p>\uff08\u6ce8\uff1a\u6709\u4e9b\u5185\u5bb9\u8f83\u957f\u7684\u547d\u4ee4\uff0c\u5728\u672c\u6587\u4e2d\u4f1a\u663e\u793a\u4e3a\u622a\u65ad\u7684\u72b6\u6001\u3002\u5982\u679c\u4f60\u9700\u8981\u9605\u8bfb\u5b8c\u6574\u7684\u547d\u4ee4\uff0c\u53ef\u4ee5\u628a\u6574\u884c\u590d\u5236\u5230\u60a8\u7684\u8bb0\u4e8b\u672c\u5f53\u4e2d\u9605\u8bfb\u3002\uff09<\/p>\n<p><strong>1\u3001\u590d\u5236SSH\u5bc6\u94a5\u5230\u76ee\u6807\u4e3b\u673a\uff0c\u5f00\u542f\u65e0\u5bc6\u7801SSH\u767b\u5f55<\/strong><\/p>\n<pre>ssh-copy-id user@host<\/pre>\n<p>\u5982\u679c\u8fd8\u6ca1\u6709\u5bc6\u94a5\uff0c\u8bf7\u4f7f\u7528ssh-keygen\u547d\u4ee4\u751f\u6210\u3002<\/p>\n<p><strong>2\u3001\u4ece\u67d0\u4e3b\u673a\u768480\u7aef\u53e3\u5f00\u542f\u5230\u672c\u5730\u4e3b\u673a2001\u7aef\u53e3\u7684\u96a7\u9053<\/strong><\/p>\n<pre>ssh -N -L2001:localhost:80 somemachine<\/pre>\n<p>\u73b0\u5728\u4f60\u53ef\u4ee5\u76f4\u63a5\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165http:\/\/localhost:2001\u8bbf\u95ee\u8fd9\u4e2a\u7f51\u7ad9\u3002<\/p>\n<p><strong>3\u3001\u5c06\u4f60\u7684\u9ea6\u514b\u98ce\u8f93\u51fa\u5230\u8fdc\u7a0b\u8ba1\u7b97\u673a\u7684\u626c\u58f0\u5668<\/strong><\/p>\n<pre>dd if=\/dev\/dsp | ssh -c arcfour -C username@host dd of=\/dev\/dsp<\/pre>\n<p>\u8fd9\u6837\u6765\u81ea\u4f60\u9ea6\u514b\u98ce\u7aef\u53e3\u7684\u58f0\u97f3\u5c06\u5728SSH\u76ee\u6807\u8ba1\u7b97\u673a\u7684\u626c\u58f0\u5668\u7aef\u53e3\u8f93\u51fa\uff0c\u4f46\u9057\u61be\u7684\u662f\uff0c\u58f0\u97f3\u8d28\u91cf\u5f88\u5dee\uff0c\u4f60\u4f1a\u542c\u5230\u5f88\u591a\u5636\u5636\u58f0\u3002<\/p>\n<p><strong>4\u3001\u6bd4\u8f83\u8fdc\u7a0b\u548c\u672c\u5730\u6587\u4ef6<\/strong><\/p>\n<pre>ssh user@host cat \/path\/to\/remotefile | diff \/path\/to\/localfile \u2013<\/pre>\n<p>\u5728\u6bd4\u8f83\u672c\u5730\u6587\u4ef6\u548c\u8fdc\u7a0b\u6587\u4ef6\u662f\u5426\u6709\u5dee\u5f02\u65f6\u8fd9\u4e2a\u547d\u4ee4\u5f88\u7ba1\u7528\u3002<\/p>\n<p><strong>5\u3001\u901a\u8fc7SSH\u6302\u8f7d\u76ee\u5f55\/\u6587\u4ef6\u7cfb\u7edf<\/strong><\/p>\n<pre>sshfs name@server:\/path\/to\/folder \/path\/to\/mount\/point<\/pre>\n<p>\u4ece<a rel=\"nofollow\" href=\"http:\/\/fuse.sourceforge.net\/sshfs.html\">http:\/\/fuse.sourceforge.net\/sshfs.html<\/a>\u4e0b\u8f7dsshfs\uff0c\u5b83\u5141\u8bb8\u4f60\u8de8\u7f51\u7edc\u5b89\u5168\u6302\u8f7d\u4e00\u4e2a\u76ee\u5f55\u3002<\/p>\n<p><strong>6\u3001\u901a\u8fc7\u4e2d\u95f4\u4e3b\u673a\u5efa\u7acbSSH\u8fde\u63a5<\/strong><\/p>\n<pre>ssh -t reachable_host ssh unreachable_host<\/pre>\n<p>Unreachable_host\u8868\u793a\u4ece\u672c\u5730\u7f51\u7edc\u65e0\u6cd5\u76f4\u63a5\u8bbf\u95ee\u7684\u4e3b\u673a\uff0c\u4f46\u53ef\u4ee5\u4ecereachable_host\u6240\u5728\u7f51\u7edc\u8bbf\u95ee\uff0c\u8fd9\u4e2a\u547d\u4ee4\u901a\u8fc7\u5230reachable_host\u7684\u201c\u9690\u85cf\u201d\u8fde\u63a5\uff0c\u521b\u5efa\u8d77\u5230unreachable_host\u7684\u8fde\u63a5\u3002<\/p>\n<p><strong>7\u3001\u5c06\u4f60\u7684SSH\u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u4e3b\u673a\uff0c\u5f00\u542f\u65e0\u5bc6\u7801\u767b\u5f55 \u2013 \u7b80\u5355\u7684\u65b9\u6cd5<\/strong><\/p>\n<pre>ssh-copy-id username@hostname<\/pre>\n<p><strong>8\u3001\u76f4\u63a5\u8fde\u63a5\u5230\u53ea\u80fd\u901a\u8fc7\u4e3b\u673aB\u8fde\u63a5\u7684\u4e3b\u673aA<\/strong><\/p>\n<pre>ssh -t hostA ssh hostB<\/pre>\n<p>\u5f53\u7136\uff0c\u4f60\u8981\u80fd\u8bbf\u95ee\u4e3b\u673aA\u624d\u884c\u3002<\/p>\n<p><strong>9\u3001\u521b\u5efa\u5230\u76ee\u6807\u4e3b\u673a\u7684\u6301\u4e45\u5316\u8fde\u63a5<\/strong><\/p>\n<pre>ssh -MNf &lt;user&gt;@&lt;host&gt;<\/pre>\n<p>\u5728\u540e\u53f0\u521b\u5efa\u5230\u76ee\u6807\u4e3b\u673a\u7684\u6301\u4e45\u5316\u8fde\u63a5\uff0c\u5c06\u8fd9\u4e2a\u547d\u4ee4\u548c\u4f60~\/.ssh\/config\u4e2d\u7684\u914d\u7f6e\u7ed3\u5408\u4f7f\u7528\uff1a<\/p>\n<pre>Host host\r\nControlPath ~\/.ssh\/master-%r@%h:%p\r\nControlMaster no<\/pre>\n<p>\u6240\u6709\u5230\u76ee\u6807\u4e3b\u673a\u7684SSH\u8fde\u63a5\u90fd\u5c06\u4f7f\u7528\u6301\u4e45\u5316SSH\u5957\u63a5\u5b57\uff0c\u5982\u679c\u4f60\u4f7f\u7528SSH\u5b9a\u671f\u540c\u6b65\u6587\u4ef6\uff08\u4f7f\u7528rsync\/sftp\/cvs\/svn\uff09\uff0c\u8fd9\u4e2a\u547d\u4ee4\u5c06\u975e\u5e38\u6709\u7528\uff0c\u56e0\u4e3a\u6bcf\u6b21\u6253\u5f00\u4e00\u4e2aSSH\u8fde\u63a5\u65f6\u4e0d\u4f1a\u521b\u5efa\u65b0\u7684\u5957\u63a5\u5b57\u3002<\/p>\n<p><strong>10\u3001\u901a\u8fc7SSH\u8fde\u63a5\u5c4f\u5e55<\/strong><\/p>\n<pre>ssh -t remote_host screen \u2013r<\/pre>\n<p>\u76f4\u63a5\u8fde\u63a5\u5230\u8fdc\u7a0b\u5c4f\u5e55\u4f1a\u8bdd\uff08\u8282\u7701\u4e86\u65e0\u7528\u7684\u7236bash\u8fdb\u7a0b\uff09\u3002<\/p>\n<p><strong>11\u3001\u7aef\u53e3\u68c0\u6d4b\uff08\u6572\u95e8\uff09<\/strong><\/p>\n<pre>knock &lt;host&gt; 3000 4000 5000 &amp;&amp; ssh -p &lt;port&gt; user@host &amp;&amp; knock &lt;host&gt; 5000 4000 3000<\/pre>\n<p>\u5728\u4e00\u4e2a\u7aef\u53e3\u4e0a\u6572\u4e00\u4e0b\u6253\u5f00\u67d0\u4e2a\u670d\u52a1\u7684\u7aef\u53e3\uff08\u5982SSH\uff09\uff0c\u518d\u6572\u4e00\u4e0b\u5173\u95ed\u8be5\u7aef\u53e3\uff0c\u9700\u8981\u5148\u5b89\u88c5knockd\uff0c\u4e0b\u9762\u662f\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\u793a\u4f8b\u3002<\/p>\n<pre>[options]\r\nlogfile = \/var\/log\/knockd.log\r\n[openSSH]\r\nsequence = 3000,4000,5000\r\nseq_timeout = 5\r\ncommand = \/sbin\/iptables -A INPUT -i eth0 -s %IP% -p tcp \u2013dport 22 -j ACCEPT\r\ntcpflags = syn\r\n[closeSSH]\r\nsequence = 5000,4000,3000\r\nseq_timeout = 5\r\ncommand = \/sbin\/iptables -D INPUT -i eth0 -s %IP% -p tcp \u2013dport 22 -j ACCEPT\r\ntcpflags = syn<\/pre>\n<p><strong>12\u3001\u5220\u9664\u6587\u672c\u6587\u4ef6\u4e2d\u7684\u4e00\u884c\u5185\u5bb9\uff0c\u6709\u7528\u7684\u4fee\u590d<\/strong><\/p>\n<pre>ssh-keygen -R &lt;the_offending_host&gt;<\/pre>\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6700\u597d\u4f7f\u7528\u4e13\u4e1a\u7684\u5de5\u5177\u3002<\/p>\n<p><strong>13\u3001\u901a\u8fc7SSH\u8fd0\u884c\u590d\u6742\u7684\u8fdc\u7a0bshell\u547d\u4ee4<\/strong><\/p>\n<pre>ssh host -l user $(&lt;cmd.txt)<\/pre>\n<p>\u66f4\u5177\u79fb\u690d\u6027\u7684\u7248\u672c\uff1a<\/p>\n<pre>ssh host -l user \u201c`cat cmd.txt`\u201d<\/pre>\n<p><strong>14\u3001\u901a\u8fc7SSH\u5c06MySQL\u6570\u636e\u5e93\u590d\u5236\u5230\u65b0\u670d\u52a1\u5668<\/strong><\/p>\n<pre>mysqldump \u2013add-drop-table \u2013extended-insert \u2013force \u2013log-error=error.log -uUSER -pPASS OLD_DB_NAME | ssh -C user@newhost \u201cmysql -uUSER -pPASS NEW_DB_NAME\u201d<\/pre>\n<p>\u901a\u8fc7\u538b\u7f29\u7684SSH\u96a7\u9053Dump\u4e00\u4e2aMySQL\u6570\u636e\u5e93\uff0c\u5c06\u5176\u4f5c\u4e3a\u8f93\u5165\u4f20\u9012\u7ed9mysql\u547d\u4ee4\uff0c\u6211\u8ba4\u4e3a\u8fd9\u662f\u8fc1\u79fb\u6570\u636e\u5e93\u5230\u65b0\u670d\u52a1\u5668\u6700\u5feb\u6700\u597d\u7684\u65b9\u6cd5\u3002<\/p>\n<p><strong>15\u3001\u5220\u9664\u6587\u672c\u6587\u4ef6\u4e2d\u7684\u4e00\u884c\uff0c\u4fee\u590d\u201cSSH\u4e3b\u673a\u5bc6\u94a5\u66f4\u6539\u201d\u7684\u8b66\u544a<\/strong><\/p>\n<pre>sed -i 8d ~\/.ssh\/known_hosts<\/pre>\n<p><strong>16\u3001\u4ece\u4e00\u53f0\u6ca1\u6709SSH-COPY-ID\u547d\u4ee4\u7684\u4e3b\u673a\u5c06\u4f60\u7684SSH\u516c\u94a5\u590d\u5236\u5230\u670d\u52a1\u5668<\/strong><\/p>\n<pre>cat ~\/.ssh\/id_rsa.pub | ssh user@machine \u201cmkdir ~\/.ssh; cat &gt;&gt; ~\/.ssh\/authorized_keys\u201d<\/pre>\n<p>\u5982\u679c\u4f60\u4f7f\u7528Mac OS X\u6216\u5176\u5b83\u6ca1\u6709ssh-copy-id\u547d\u4ee4\u7684*nix\u53d8\u79cd\uff0c\u8fd9\u4e2a\u547d\u4ee4\u53ef\u4ee5\u5c06\u4f60\u7684\u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u4e3b\u673a\uff0c\u56e0\u6b64\u4f60\u7167\u6837\u53ef\u4ee5\u5b9e\u73b0\u65e0\u5bc6\u7801SSH\u767b\u5f55\u3002<\/p>\n<p><strong>17\u3001\u5b9e\u65f6SSH\u7f51\u7edc\u541e\u5410\u91cf\u6d4b\u8bd5<\/strong><\/p>\n<pre>yes | pv | ssh $host \u201ccat &gt; \/dev\/null\u201d<\/pre>\n<p>\u901a\u8fc7SSH\u8fde\u63a5\u5230\u4e3b\u673a\uff0c\u663e\u793a\u5b9e\u65f6\u7684\u4f20\u8f93\u901f\u5ea6\uff0c\u5c06\u6240\u6709\u4f20\u8f93\u6570\u636e\u6307\u5411\/dev\/null\uff0c\u9700\u8981\u5148\u5b89\u88c5pv\u3002<\/p>\n<p>\u5982\u679c\u662fDebian\uff1a<\/p>\n<pre>apt-get install pv<\/pre>\n<p>\u5982\u679c\u662fFedora\uff1a<\/p>\n<pre>yum install pv<\/pre>\n<p>\uff08\u53ef\u80fd\u9700\u8981\u542f\u7528\u989d\u5916\u7684\u8f6f\u4ef6\u4ed3\u5e93\uff09\u3002<\/p>\n<p><strong>18\u3001\u5982\u679c\u5efa\u7acb\u4e00\u4e2a\u53ef\u4ee5\u91cd\u65b0\u8fde\u63a5\u7684\u8fdc\u7a0bGNU screen<\/strong><\/p>\n<pre>ssh -t user@some.domain.com \/usr\/bin\/screen \u2013xRR<\/pre>\n<p>\u4eba\u4eec\u603b\u662f\u559c\u6b22\u5728\u4e00\u4e2a\u6587\u672c\u7ec8\u7aef\u4e2d\u6253\u5f00\u8bb8\u591ashell\uff0c\u5982\u679c\u4f1a\u8bdd\u7a81\u7136\u4e2d\u65ad\uff0c\u6216\u4f60\u6309\u4e0b\u4e86\u201cCtrl-a d\u201d\uff0c\u8fdc\u7a0b\u4e3b\u673a\u4e0a\u7684shell\u4e0d\u4f1a\u53d7\u5230\u4e1d\u6beb\u5f71\u54cd\uff0c\u4f60\u53ef\u4ee5\u91cd\u65b0\u8fde\u63a5\uff0c\u5176\u5b83\u6709\u7528\u7684screen\u547d\u4ee4\u6709\u201cCtrl-a c\u201d\uff08\u6253\u5f00\u65b0\u7684shell\uff09\u548c\u201cCtrl-a a\u201d\uff08\u5728shell\u4e4b\u95f4\u6765\u56de\u5207\u6362\uff09\uff0c\u8bf7\u8bbf\u95eehttp:\/\/aperiodic.net\/screen\/quick_reference\u9605\u8bfb\u66f4\u591a\u5173\u4e8escreen\u547d\u4ee4\u7684\u5feb\u901f\u53c2\u8003\u3002<\/p>\n<p><strong>19\u3001\u7ee7\u7eedSCP\u5927\u6587\u4ef6<\/strong><\/p>\n<pre>rsync \u2013partial \u2013progress \u2013rsh=ssh $file_source $user@$host:$destination_file<\/pre>\n<p>\u5b83\u53ef\u4ee5\u6062\u590d\u5931\u8d25\u7684rsync\u547d\u4ee4\uff0c\u5f53\u4f60\u901a\u8fc7VPN\u4f20\u8f93\u5927\u6587\u4ef6\uff0c\u5982\u5907\u4efd\u7684\u6570\u636e\u5e93\u65f6\u8fd9\u4e2a\u547d\u4ee4\u975e\u5e38\u6709\u7528\uff0c\u9700\u8981\u5728\u4e24\u8fb9\u7684\u4e3b\u673a\u4e0a\u5b89\u88c5rsync\u3002<\/p>\n<pre>rsync \u2013partial \u2013progress \u2013rsh=ssh $file_source $user@$host:$destination_file local -&gt; remote<\/pre>\n<p>\u6216<\/p>\n<pre>rsync \u2013partial \u2013progress \u2013rsh=ssh $user@$host:$remote_file $destination_file remote -&gt; local<\/pre>\n<p><strong>20\u3001\u901a\u8fc7SSH W\/ WIRESHARK\u5206\u6790\u6d41\u91cf<\/strong><\/p>\n<pre>ssh root@server.com \u2018tshark -f \u201cport !22\u2033 -w -' | wireshark -k -i \u2013<\/pre>\n<p>\u4f7f\u7528tshark\u6355\u6349\u8fdc\u7a0b\u4e3b\u673a\u4e0a\u7684\u7f51\u7edc\u901a\u4fe1\uff0c\u901a\u8fc7SSH\u8fde\u63a5\u53d1\u9001\u539f\u59cbpcap\u6570\u636e\uff0c\u5e76\u5728wireshark\u4e2d\u663e\u793a\uff0c\u6309\u4e0bCtrl+C\u5c06\u505c\u6b62\u6355\u6349\uff0c\u4f46\u4e5f\u4f1a\u5173\u95edwireshark\u7a97\u53e3\uff0c\u53ef\u4ee5\u4f20\u9012\u4e00\u4e2a\u201c-c #\u201d\u53c2\u6570\u7ed9tshark\uff0c\u8ba9\u5b83\u53ea\u6355\u6349\u201c#\u201d\u6307\u5b9a\u7684\u6570\u636e\u5305\u7c7b\u578b\uff0c\u6216\u901a\u8fc7\u547d\u540d\u7ba1\u9053\u91cd\u5b9a\u5411\u6570\u636e\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u901a\u8fc7SSH\u4f20\u8f93\u7ed9wireshark\uff0c\u6211\u5efa\u8bae\u4f60\u8fc7\u6ee4\u6570\u636e\u5305\uff0c\u4ee5\u8282\u7ea6\u5e26\u5bbd\uff0ctshark\u53ef\u4ee5\u4f7f\u7528tcpdump\u66ff\u4ee3\uff1a<\/p>\n<pre>ssh root@example.com tcpdump -w \u2013 \u2018port !22\u2032 | wireshark -k -i \u2013<\/pre>\n<p><strong>21\u3001\u4fdd\u6301SSH\u4f1a\u8bdd\u6c38\u4e45\u6253\u5f00<\/strong><\/p>\n<pre>autossh -M50000 -t server.example.com \u2018screen -raAd mysession\u2019<\/pre>\n<p>\u6253\u5f00\u4e00\u4e2aSSH\u4f1a\u8bdd\u540e\uff0c\u8ba9\u5176\u4fdd\u6301\u6c38\u4e45\u6253\u5f00\uff0c\u5bf9\u4e8e\u4f7f\u7528\u7b14\u8bb0\u672c\u7535\u8111\u7684\u7528\u6237\uff0c\u5982\u679c\u9700\u8981\u5728Wi-Fi\u70ed\u70b9\u4e4b\u95f4\u5207\u6362\uff0c\u53ef\u4ee5\u4fdd\u8bc1\u5207\u6362\u540e\u4e0d\u4f1a\u4e22\u5931\u8fde\u63a5\u3002<\/p>\n<p><strong>22\u3001\u66f4\u7a33\u5b9a\uff0c\u66f4\u5feb\uff0c\u66f4\u5f3a\u7684SSH\u5ba2\u6237\u7aef<\/strong><\/p>\n<pre>ssh -4 -C -c blowfish-cbc<\/pre>\n<p>\u5f3a\u5236\u4f7f\u7528IPv4\uff0c\u538b\u7f29\u6570\u636e\u6d41\uff0c\u4f7f\u7528Blowfish\u52a0\u5bc6\u3002<\/p>\n<p><strong>23\u3001\u4f7f\u7528cstream\u63a7\u5236\u5e26\u5bbd<\/strong><\/p>\n<pre>tar -cj \/backup | cstream -t 777k | ssh host \u2018tar -xj -C \/backup\u2019<\/pre>\n<p>\u4f7f\u7528bzip\u538b\u7f29\u6587\u4ef6\u5939\uff0c\u7136\u540e\u4ee5777k bit\/s\u901f\u7387\u5411\u8fdc\u7a0b\u4e3b\u673a\u4f20\u8f93\u3002Cstream\u8fd8\u6709\u66f4\u591a\u7684\u529f\u80fd\uff0c\u8bf7\u8bbf\u95eehttp:\/\/www.cons.org\/cracauer\/cstream.html#usage\u4e86\u89e3\u8be6\u60c5\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>echo w00t, i\u2019m 733+ | cstream -b1 -t2<\/pre>\n<p><strong>24\u3001\u4e00\u6b65\u5c06SSH\u516c\u94a5\u4f20\u8f93\u5230\u53e6\u4e00\u53f0\u673a\u5668<\/strong><\/p>\n<pre>ssh-keygen; ssh-copy-id user@host; ssh user@host<\/pre>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u7ec4\u5408\u5141\u8bb8\u4f60\u65e0\u5bc6\u7801SSH\u767b\u5f55\uff0c\u6ce8\u610f\uff0c\u5982\u679c\u5728\u672c\u5730\u673a\u5668\u7684~\/.ssh\u76ee\u5f55\u4e0b\u5df2\u7ecf\u6709\u4e00\u4e2aSSH\u5bc6\u94a5\u5bf9\uff0cssh-keygen\u547d\u4ee4\u751f\u6210\u7684\u65b0\u5bc6\u94a5\u53ef\u80fd\u4f1a\u8986\u76d6\u5b83\u4eec\uff0cssh-copy-id\u5c06\u5bc6\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u4e3b\u673a\uff0c\u5e76\u8ffd\u52a0\u5230\u8fdc\u7a0b\u8d26\u53f7\u7684~\/.ssh\/authorized_keys\u6587\u4ef6\u4e2d\uff0c\u4f7f\u7528SSH\u8fde\u63a5\u65f6\uff0c\u5982\u679c\u4f60\u6ca1\u6709\u4f7f\u7528\u5bc6\u94a5\u53e3\u4ee4\uff0c\u8c03\u7528ssh user@host\u540e\u4e0d\u4e45\u5c31\u4f1a\u663e\u793a\u8fdc\u7a0bshell\u3002<\/p>\n<p><strong>25\u3001\u5c06\u6807\u51c6\u8f93\u5165\uff08stdin\uff09\u590d\u5236\u5230\u4f60\u7684X11\u7f13\u51b2\u533a<\/strong><\/p>\n<pre>ssh user@host cat \/path\/to\/some\/file | xclip<\/pre>\n<p>\u4f60\u662f\u5426\u4f7f\u7528scp\u5c06\u6587\u4ef6\u590d\u5236\u5230\u5de5\u4f5c\u7528\u7535\u8111\u4e0a\uff0c\u4ee5\u4fbf\u590d\u5236\u5176\u5185\u5bb9\u5230\u7535\u5b50\u90ae\u4ef6\u4e2d\uff1fxclip\u53ef\u4ee5\u5e2e\u5230\u4f60\uff0c\u5b83\u53ef\u4ee5\u5c06\u6807\u51c6\u8f93\u5165\u590d\u5236\u5230X11\u7f13\u51b2\u533a\uff0c\u4f60\u9700\u8981\u505a\u7684\u5c31\u662f\u70b9\u51fb\u9f20\u6807\u4e2d\u952e\u7c98\u8d34\u7f13\u51b2\u533a\u4e2d\u7684\u5185\u5bb9\u3002<\/p>\n<p>\u6211\u770b\u73a9\u8fd9\u4e9b\u540e\u53c8\u56de\u5230\u4e86WINDOWS\u7684DOS\u5e74\u4ee3<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OpenSSH\u662fSSH\u8fde\u63a5\u5de5\u5177\u7684\u514d\u8d39\u7248\u672c\u3002telnet\uff0crlogin\u548cftp\u7528\u6237\u53ef\u80fd\u8fd8\u6ca1\u610f\u8bc6\u5230\u4ed6\u4eec\u5728\u4e92\u8054\u7f51\u4e0a\u4f20\u8f93\u7684\u5bc6\u7801\u662f\u672a\u52a0\u5bc6\u7684\uff0c\u4f46SSH\u662f\u52a0\u5bc6\u7684\uff0cOpenSSH\u52a0\u5bc6\u6240\u6709\u901a\u4fe1\uff08\u5305\u62ec\u5bc6\u7801\uff09\uff0c\u6709\u6548\u6d88\u9664\u4e86\u7a83\u542c\uff0c\u8fde\u63a5\u52ab\u6301\u548c\u5176\u5b83\u653b\u51fb\u3002\u6b64\u5916\uff0cOpenS&#8230;<\/p>\n","protected":false},"author":1,"featured_media":67163,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[107,1,7],"tags":[110,114],"topic":[],"class_list":["post-67162","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nas","category-technology","category-server","tag-openmediavault","tag-ssh"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/67162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/comments?post=67162"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/67162\/revisions"}],"predecessor-version":[{"id":67164,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/67162\/revisions\/67164"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media\/67163"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=67162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=67162"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=67162"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=67162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}