<?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>smallfish logs &#187; Linux</title>
	<atom:link href="http://chenxiaoyu.org/blog/archives/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://chenxiaoyu.org</link>
	<description>关注 Python &#38; Go &#38; PostgreSQL</description>
	<lastBuildDate>Sat, 07 Aug 2010 10:31:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SSH, SCP 不输入密码</title>
		<link>http://chenxiaoyu.org/blog/archives/133</link>
		<comments>http://chenxiaoyu.org/blog/archives/133#comments</comments>
		<pubDate>Wed, 16 Dec 2009 01:17:44 +0000</pubDate>
		<dc:creator>smallfish</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://chenxiaoyu.org/blog/?p=133</guid>
		<description><![CDATA[经常在不同linux机器之间互相scp拷文件，每次总是要输入密码才可行。
通过ssh-keygen生成公钥，在两台机器之间互相建立信任通道即可。假设本地机器client，远程机器为server。
1. 生成rsa keygen
[winter@client winter] $ ssh-keygen -b 1024 -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/winter/.ssh/id_rsa): &#60;Enter&#62;
Enter passphrase (empty for no passphrase): &#60;Enter&#62;
Enter same passphrase again: &#60;Enter&#62;
Your identification has been saved in /home/winter/.ssh/id_rsa.
Your public key has been saved in /home/winter/.ssh/id_rsa.pub.
The key fingerprint is:
33:d4:7b:9c:87:04:cf:14:40:22:6d:c7:15:78:97:6a winter@client
直接上面公钥和私钥存放地址可以直接回车，私钥密码可以直接回车，也可以输入。
2. 查看.ssh目录下了多私钥和公钥文件
[winter@client winter] $ ls .ssh/
id_rsa  [...]]]></description>
			<content:encoded><![CDATA[<p>经常在不同linux机器之间互相scp拷文件，每次总是要输入密码才可行。</p>
<p>通过ssh-keygen生成公钥，在两台机器之间互相建立信任通道即可。假设本地机器client，远程机器为server。</p>
<p>1. 生成rsa keygen</p>
<pre>[winter@client winter] $ ssh-keygen -b 1024 -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/winter/.ssh/id_rsa): &lt;Enter&gt;
Enter passphrase (empty for no passphrase): &lt;Enter&gt;
Enter same passphrase again: &lt;Enter&gt;
Your identification has been saved in /home/winter/.ssh/id_rsa.
Your public key has been saved in /home/winter/.ssh/id_rsa.pub.
The key fingerprint is:
33:d4:7b:9c:87:04:cf:14:40:22:6d:c7:15:78:97:6a winter@client</pre>
<p>直接上面公钥和私钥存放地址可以直接回车，私钥密码可以直接回车，也可以输入。</p>
<p>2. 查看.ssh目录下了多私钥和公钥文件</p>
<pre>[winter@client winter] $ ls .ssh/
id_rsa  id_rsa.pub  known_hosts</pre>
<p>3. 拷贝公钥到目标机器上，并改名成authorized_keys</p>
<p>首次scp命令时候还是会提示输入密码，还有是否继续链接的提示，以后</p>
<p>4. 测试ssh进入</p>
<pre>[winter@client winter] $ ssh 192.168.0.110</pre>
<p>5. ok，搞定！</p>
<pre>[winter@server winter] # it's ok!</pre>
<hr />
<p><small>© smallfish for <a href="http://chenxiaoyu.org">smallfish logs</a>, 2009. |
<a href="http://chenxiaoyu.org/blog/archives/133">Permalink</a> |
<a href="http://chenxiaoyu.org/blog/archives/133#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://chenxiaoyu.org/blog/archives/133&title=SSH, SCP 不输入密码">del.icio.us</a>
<br/>
Post tags: <a href="http://chenxiaoyu.org/blog/archives/tag/ssh" rel="tag">SSH</a><br/>
</small></p>
<p>
<script type="text/javascript"><!--
google_ad_client = "pub-8914011260472945";
/* 468x60, 创建于 09-11-19 */
google_ad_slot = "7198645178";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://chenxiaoyu.org/blog/archives/133/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
