<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SSH &#8211; nood1es</title>
	<atom:link href="https://yijie.lu/category/tools/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>https://yijie.lu</link>
	<description>Rick&#039;s Blog</description>
	<lastBuildDate>Thu, 18 May 2017 07:04:59 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.2.4</generator>

<image>
	<url>https://yijie.lu/wp-content/uploads/2017/05/411.png</url>
	<title>SSH &#8211; nood1es</title>
	<link>https://yijie.lu</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>关于SSH的若干</title>
		<link>https://yijie.lu/something-about-ssh/</link>
				<comments>https://yijie.lu/something-about-ssh/#respond</comments>
				<pubDate>Wed, 03 May 2017 02:59:37 +0000</pubDate>
		<dc:creator><![CDATA[Rick Lu]]></dc:creator>
				<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">https://yijie.lu/?p=20</guid>
				<description><![CDATA[<p>很早就想总结一篇关于SSH的文章。 SSH、SSH Key、SFTP、SCP等等一直都在用，但是很少总结和体会 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://yijie.lu/something-about-ssh/">关于SSH的若干</a> appeared first on <a rel="nofollow" href="https://yijie.lu">nood1es</a>.</p>
]]></description>
								<content:encoded><![CDATA[<p>很早就想总结一篇关于SSH的文章。</p>
<p>SSH、SSH Key、SFTP、SCP等等一直都在用，但是很少总结和体会。本着烂笔头法则，总结一下。</p>
<p>SSH即Secure Shell，实际上就是在应用层的网络服务上的一种加密协议。起初应用于Unix/Linux的系统上。SSH主要采用公钥-密钥模式进行验证。目前最新版本是发布于2006年的2.x。</p>
<p>此处以SSH协议的三个应用来展开，大家可以根据协议在这三个应用中的具体实现来体会SSH本身。</p>
<p><span id="more-20"></span></p>
<h4>SFTP／SCP：</h4>
<p>这两个应用都是在日常工作中非常常用的工具。其原理就是通过SSH构建一条加密隧道，进行网络传输。它们本身仍然基于SSHD进程，没有属于自己的守护进程。共用22端口。需要注意的是，由于存在加解密，其传输效率低于FTP／CP</p>
<p>Win平台下，有很多软件集成了SFTP，诸如FileZilla，WinSCP，Xftp。而Unix类平台下，几乎没有好用的GUI工具（存疑？）SCP就是大杀器了。配合下文中所提到的登陆验证，日常传输个config什么的都很方便。</p>
<pre class="EnlighterJSRAW" data-enlighter-language="shell">usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2</pre>
<h4>SSH AUTHENTICATION：</h4>
<p>自从转到macOS后，XShell这个神器就没法用了。我还专门发邮件给netsarang，但是无奈macOS的逼格之高（误）和人家的市场定位（大误）。还是只能安心用terminal了。但是真的很蛋疼啊，每次ssh root@。。。特别麻烦。更甚的是我带着问题问几个macOS专业户，人家都表示，ssh就很好了呀。。。</p>
<p>不过最后也算找到了办法：</p>
<p>-首先配制一套用来登陆的SSH公钥密钥，这里不推荐全部地方都用一套密钥。</p>
<pre class="EnlighterJSRAW" data-enlighter-language="shell">ssh-keygen -t rsa -C “youremail@email.com”</pre>
<p>-得到公钥和私钥后，scp到目标服务器</p>
<pre class="EnlighterJSRAW" data-enlighter-language="shell">scp ~/.ssh/id_rsa_auth.pub root@x.x.x.x:~/.ssh/</pre>
<p>#在目标服务器里</p>
<pre class="EnlighterJSRAW" data-enlighter-language="shell">cat id_rsa_auth.pub &gt;&gt; ~/.ssh/authorized_keys</pre>
<p>-在本机.ssh/下新建config如下</p>
<p>&nbsp;</p>
<pre class="EnlighterJSRAW" data-enlighter-language="shell">#Host别名

Host nickname

#Host IP

hostname x.x.x.x

#Host User

user root

#验证密钥

IdentityFile ~/.ssh/id_rsa_auth</pre>
<p>-大功告成。</p>
<p>下次登陆的时候直接ssh nickname 你就会发现，无比爽快！</p>
<p><img class="alignnone size-full wp-image-23" src="https://yijie.lu/wp-content/uploads/2017/05/WX20170518-150343.png" alt="" width="580" height="240" /></p>
<p>Enjoy ：）</p>
<h4>REFER：</h4>
<p>https://www.ibm.com/developerworks/cn/aix/library/au-sshsecurity/</p>
<p>https://en.wikipedia.org/wiki/Secure_Shell</p>
<p>https://tools.ietf.org/html/draft-ietf-secsh-filexfer-13</p>
<p>The post <a rel="nofollow" href="https://yijie.lu/something-about-ssh/">关于SSH的若干</a> appeared first on <a rel="nofollow" href="https://yijie.lu">nood1es</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://yijie.lu/something-about-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
