<?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>夜行人 &#187; SSH</title>
	<atom:link href="http://www.187299.com/archives/tag/ssh/feed" rel="self" type="application/rss+xml" />
	<link>http://www.187299.com</link>
	<description>寻觅生命中的那一片浅草......</description>
	<lastBuildDate>Wed, 16 Nov 2011 11:25:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Linux下SecureCRT的替代品：PAC Manager</title>
		<link>http://www.187299.com/archives/1794</link>
		<comments>http://www.187299.com/archives/1794#comments</comments>
		<pubDate>Fri, 04 Mar 2011 16:21:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1794</guid>
		<description><![CDATA[在windows下管理linux服务器，经常用的是securecrt，它主要特性有 1、标签式管理 2、标签可以克隆，方便在不同标签完成不同工作 3、服务器列表支持分类 4、缓存key的 passphrase，只需要输入一次，... ]]></description>
			<content:encoded><![CDATA[<p>在windows下管理linux服务器，经常用的是securecrt，它主要特性有</p>
<p>1、标签式管理<br />
2、标签可以克隆，方便在不同标签完成不同工作<br />
3、服务器列表支持分类<br />
4、缓存key的 passphrase，只需要输入一次，后续使用该key的服务器访问都不需要再输入<br />
5、Forward agent.</p>
<p>大家通过用securecrt登录到2台服务器，2台服务器上都有自己的key，这时，2台服务器上不需要额外的设置即可以相互scp文件，这个过程用的就是 SSH的Forward agent特性，它把认证进行转发。</p>
<p>而我们在linux下管理linux，比较常用的是gnome terminal，这个与securecrt比起来，未免太原始了，敲命令，敲到手抽筋，最近在网上找securecrt的替代工具，竟然在WOW！Ubuntu上找到了PAC Manager 。</p>
<p>http://wowubuntu.com/pac-254.html</p>
<p>它主要特性：<br />
1、标签式管理<br />
2、标签可以克隆，方便在不同标签完成不同工作<br />
3、服务器列表支持分类<br />
4、Forward agent（这个可以通过PAC本身的配置实现，有可以通过修改/etc/ssh/ssh_config的配置来实现）.</p>
<p>对比下可以看到，PAC Manager不支持缓存passphrase，这意味着，你每登录一台服务器 ，你都需要输入一次你key的 passphrase，但这个可以通过修改系统配置来达到.</p>
<p>我在ubuntu 10.10上安装了，下面先来做简单介绍</p>
<p>下面说下PAC Manager的图形化操作<br />
添加组：<br />
PAC窗口左上角“GROUP”显示的是组信息，点击添加可以新建分组</p>
<p>左下角是添加服务器列表，点击添加可以添加服务器信息</p>
<p>填好IP，用户名和密码等，如果是用key登录，密码留空即，再指定key的位置</p>
<p>"Edit connection" -&gt; "Connections Properties" -&gt; "Advanced Options":</p>
<p>-o "IdentityFile=/path/to/my_private_key_file"</p>
<p>如果想登录2台服务器，可以相互scp文件，则需要在“CONNECTION PROPERTIES”里把“Forward Agent”选上。</p>
<p>这样就可以进行连接了</p>
<p>每台服务器都需要指定key，这个未免太麻烦了，另外有些服务器需要使用另一个key，而且每次使用key登录服务器，都需要输入key的passphrase，为解决这个问题，我们只要把要用到的private key都交给ssh-agent来进行管理，，每个key只需要输入一次passphrase，后面的登录，就不用输入密码了。</p>
<p>ssh-agent 是个管理 private key 的 passphrase 的工具，启动<br />
ssh-agent<br />
添加需要被ssh-agent管理的key，假设你的private key名是id_rsa<br />
ssh-add id_rsa<br />
此时需要输入一次 private key 的 passphrase ，输入正确后，passphrase 就归 ssh-agent 管理，往后的 ssh 操作，就不需要询问 passphrase 了</p>
<p>ssh-add -l 可以看到现有托管的key</p>
<p>PAC Manager的配置文件保存在/home/user/.pac/pac.yml<br />
如果有大量服务器需要添加，可以写脚本，直接生成配置文件放到/home/user/.pac/pac.yml</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1794/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ssh+chroot+jailit锁定普通用户活动目录</title>
		<link>http://www.187299.com/archives/1521</link>
		<comments>http://www.187299.com/archives/1521#comments</comments>
		<pubDate>Tue, 23 Mar 2010 11:29:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1521</guid>
		<description><![CDATA[原文链接：http://bbs.linuxtone.org/thread-2937-1-1.html IT运维专家网--"自由平等，互助分享！" http://olivier.sessink.nl/jailkit/jailkit-2.0.tar.gz tar -zxvf jailkit-2.0.tar.gz cd jailkit-2.0 ./configure make make install mkdir /jail ch... ]]></description>
			<content:encoded><![CDATA[<p>原文链接：http://bbs.linuxtone.org/thread-2937-1-1.html IT运维专家网--"自由平等，互助分享！"</p>
<p>http://olivier.sessink.nl/jailkit/jailkit-2.0.tar.gz</p>
<p>tar -zxvf jailkit-2.0.tar.gz<br />
cd jailkit-2.0<br />
./configure<br />
make<br />
make install<br />
mkdir /jail<br />
chown root:root /jail</p>
<p>jk_init -v /jail basicshell<br />
jk_init -v /jail editors<br />
jk_init -v /jail extendedshell<br />
jk_init -v /jail netutils<br />
jk_init -v /jail ssh<br />
jk_init -v /jail sftp</p>
<p>adduser thomas</p>
<p>jk_jailuser -m -j /jail thomas</p>
<p>vi /etc/passwd:<br />
thomas:x:1001:500::/jail/./home/thomas:/usr/sbin/jk_chrootsh</p>
<p>passwd thomas</p>
<p>mkdir -p /jail/home/thomas</p>
<p>chown thomas:thomas /jail/home/thomas</p>
<p>vi /jail/etc/group<br />
paste and save this:<br />
thomas:x:500:</p>
<p>vi /jail/etc/passwd<br />
paste and save this:<br />
thomas:x:1001:500::/home/thomas:/bin/bash</p>
<p>cp /etc/skel/.bashrc /jail/home/thomas<br />
chown thomas:thomas /jail/home/thomas/.bashrc<br />
ssh thomas@localhost</p>
<p>千万不要死套用，这只是我配置成功的过程，可能某些地方和大家有点差别要灵活运用</p>
<p>现在已经出到2.11版了，我自己的安装过程<br />
以下是它安装的一些文件<br />
/usr/bin/install -c -d -m 755 /usr<br />
/usr/bin/install -c -d -m 755 /usr/bin<br />
/usr/bin/install -c -d -m 755 /usr/sbin<br />
/usr/bin/install -c -m 0755 jk_socketd /usr/sbin/<br />
/usr/bin/install -c -m 0755 jk_chrootlaunch /usr/sbin/<br />
/usr/bin/install -c -m 0755 jk_lsh /usr/sbin/<br />
/usr/bin/install -c -m 4755 jk_chrootsh /usr/sbin/<br />
/usr/bin/install -c -m 4755 jk_uchroot /usr/bin/</p>
<p>在执行<br />
jk_jailuser -m -j /jail thomas<br />
时，会提示找不到命令，我们手动复制过去</p>
<p>mkdir /jail/usr/sbin<br />
cd /jail/usr/sbin<br />
/bin/cp -a /usr/sbin/* .</p>
<p>另外/jail/etc/passwd中<br />
thomas:x:504:505::/home/thomas:/usr/sbin/jk_lsh<br />
默认的shell是/usr/sbin/jk_lsh，当设置为这个时，登录会提示/usr/sbin/jk_lsh: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory</p>
<p>后来把/usr/sbin/jk_lsh修改为/bin/bash则可以正常登录</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1521/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SecureCRT中文版scp时无法用key</title>
		<link>http://www.187299.com/archives/1421</link>
		<comments>http://www.187299.com/archives/1421#comments</comments>
		<pubDate>Thu, 17 Dec 2009 11:25:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1421</guid>
		<description><![CDATA[SecureCRT中文版scp时无法用key 需要输入密码 英文版没有遇到过 选项--&#62;全局选项--&#62;SSH2，选上启用OpenSSH代理程... ]]></description>
			<content:encoded><![CDATA[<p>SecureCRT中文版scp时无法用key<br />
需要输入密码<br />
英文版没有遇到过<br />
选项--&gt;全局选项--&gt;SSH2，选上启用OpenSSH代理程序</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1421/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>secureCRT断开服务器连接</title>
		<link>http://www.187299.com/archives/1290</link>
		<comments>http://www.187299.com/archives/1290#comments</comments>
		<pubDate>Tue, 27 Oct 2009 08:52:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=1290</guid>
		<description><![CDATA[解决的方法： 在session options-&#62;Terminal-&#62;Anti-idle-&#62;send protocol NO-OP every?seconds... ]]></description>
			<content:encoded><![CDATA[<p>解决的方法：</p>
<p>在session options-&gt;Terminal-&gt;Anti-idle-&gt;send protocol NO-OP every?seconds.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1290/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关闭ssh的HostKeyChecking</title>
		<link>http://www.187299.com/archives/1250</link>
		<comments>http://www.187299.com/archives/1250#comments</comments>
		<pubDate>Thu, 08 Oct 2009 07:25:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.187299.com/archives/1250</guid>
		<description><![CDATA[关闭ssh的HostKeyChecking The authenticity of host '11.22.33.44 (11.22.33.44)' can't be established. RSA key fingerprint is b7:2f:12:ff:a8:97:a3:09:13:41:c0:e8:ab:7a:6f:ed. Are you sure you want to continue connecting (yes/no)? RSA host key for 11.22.3... ]]></description>
			<content:encoded><![CDATA[<p>关闭ssh的HostKeyChecking</p>
<p>The authenticity of host '11.22.33.44 (11.22.33.44)' can't be established.<br />
RSA key fingerprint is b7:2f:12:ff:a8:97:a3:09:13:41:c0:e8:ab:7a:6f:ed.<br />
Are you sure you want to continue connecting (yes/no)?</p>
<p>RSA host key for 11.22.33.44 has changed and you have requested strict checking</p>
<p>ssh到远程服务器时时，是否觉得很烦<br />
修改下ssh的配置就可以了,当然，必须确定远程主机是可信任的<br />
vi /etc/ssh/ssh_config<br />
将<br />
#   StrictHostKeyChecking ask<br />
修改为<br />
StrictHostKeyChecking no</p>
<p>service sshd reload</p>
<p>这样就可以了</p>
<p>如果想单次连接取消，则可以用命令</p>
<p>ssh -o StrictHostKeyChecking=no  192.168.6.12</p>
<p>其他命令</p>
<p>ssh -o StrictHostKeyChecking=no -o CheckHostIP=no -o  UserKnownHostsFile=/dev/null 192.168.6.12</p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/1250/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用script记录Linux终端会话</title>
		<link>http://www.187299.com/archives/868</link>
		<comments>http://www.187299.com/archives/868#comments</comments>
		<pubDate>Fri, 15 May 2009 08:47:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.187299.com/?p=868</guid>
		<description><![CDATA[许多系统管理员都知道保留一个包含各种任务、配置改变等活动日志的重要性。对一些组织而言，保留“我做了这件事”或“约翰做了那件事”的简单日志就已足够；但另一些组织则需要记录... ]]></description>
			<content:encoded><![CDATA[<p>许多系统管理员都知道保留一个包含各种任务、配置改变等活动日志的重要性。对一些组织而言，保留“我做了这件事”或“约翰做了那件事”的简单日志就已足够；但另一些组织则需要记录所有改变。</p>
<p>对终端输出进行复制粘贴可能非常乏味，我们使用一个叫做script的鲜为人知的程序来解决这个问题，它是大多数Linux产品util-linux软件包的一部分。</p>
<p>script记录会话的一切内容：你输入的内容和你看到的内容。它甚至记录颜色；因此如果你的命令提示符或程序输出中包含颜色，script将记录它。</p>
<p><span id="more-868"></span></p>
<p>要使用script，简单执行以下命令：</p>
<p>$ script</p>
<p>默认情况下，它向当前目录的typescript文件中写入内容。然后，你输入的一切内容都被记录到那个文件中。要往另一个文件中记录日志，只需使用script/path/to/file命令。</p>
<p>完成记录后，输入exit退出。这个命令将关闭script会话并保存文件。现在你可以使用cat或其它任何程序来检查日志文件。</p>
<p>使用script的缺点在于，它记录所有特殊的字符；因此你输入的文件中将充满控制字符和ANSI转义序列。你可以在script中使用一个非常简单的shell来解决这个问题：</p>
<p>$ SHELL=/bin/sh PS1="$ " script</p>
<p>使用script时，不要使用交互式程序或处理窗口的程序，如vior top。它们会破坏会话的输出结果。另外，日志文件会记录你使用的任何命令行程序和你完成一项任务所采取的步骤。如果你需要在脚本中编辑一个文件，考虑退出script会话，然后用script –a（它在旧会话后添加新会话）对文件进行编辑后再重新启动会话。</p>
<p>转载自：<a href="http://www.builder.com.cn/2007/0313/381363.shtml" target="_blank">http://www.builder.com.cn/2007/0313/381363.shtml</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/868/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在SSH终端上显示中文字符</title>
		<link>http://www.187299.com/archives/719</link>
		<comments>http://www.187299.com/archives/719#comments</comments>
		<pubDate>Sun, 03 May 2009 15:57:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.momati.net/?p=719</guid>
		<description><![CDATA[■■方法1■■ 在/etc/bashrc中加入export LC_ALL=en_US.UTF-8 如此，shell的语言是英文，但是可以显示中文字符。 ■■方法2■■ 在/etc/bashrc中加入export LC_ALL=en_US.UTF-8 如此，shell的语言是中文，也可以显... ]]></description>
			<content:encoded><![CDATA[<p>■■方法1■■</p>
<p>在/etc/bashrc中加入export LC_ALL=en_US.UTF-8<br />
如此，shell的语言是英文，但是可以显示中文字符。</p>
<p>■■方法2■■</p>
<p>在/etc/bashrc中加入export LC_ALL=en_US.UTF-8<br />
如此，shell的语言是中文，也可以显示中文字符。</p>
<p>■■方法3■■</p>
<p>编辑/etc/sysconfig/i18n，修改为如下内容：</p>
<p>LANG="en_US"<br />
SUPPORTED="en_US.UTF-8:en_US:en"<br />
SYSFONT="latarcyrheb-sun16"</p>
<p>这样设置，操作系统语言是英文，但是将可以显示中文字符。</p>
<p>转载自：<a href="http://www.chengzhidan.com.cn/read.php/476.htm" target="_blank">http://www.chengzhidan.com.cn/read.php/476.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/719/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用Screen创建虚拟终端避免Linux远程断线</title>
		<link>http://www.187299.com/archives/97</link>
		<comments>http://www.187299.com/archives/97#comments</comments>
		<pubDate>Mon, 20 Apr 2009 08:27:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.momati.net/archives/97</guid>
		<description><![CDATA[维护Linux的ssh工具在使用中，一旦遇到网络中断，则当前的shell就会自动关闭 当前的工作进度就会丢失，这对于远程升级等比较耗费时间的工作是非常不利的 对于远程调适代码也是很不可靠不... ]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: small;">维护Linux的ssh工具在使用中，一旦遇到网络中断，则当前的shell就会自动关闭<br />
当前的工作进度就会丢失，这对于远程升级等比较耗费时间的工作是非常不利的<br />
对于远程调适代码也是很不可靠不安全的<br />
为此，可以使用screen这个工具来解决这个问题。</span></p>
<p><span style="font-size: small;"><span id="more-97"></span><br />
</span></p>
<p><span style="font-size: small;">对于最小化的linux，通常screen是不包含在系统内的。<br />
需要查找操作系统的安装光盘，例如对于AS4update4<br />
在其中的CD4.iso里边可找到screen-4.0.2-5.i386.rpm<br />
到服务器上执行rpm -ivh screen-4.0.2-5.i386.rpm即可安装完成</span></p>
<p><span style="font-size: small;">打开一个ssh终端，执行screen，并回车，即可创建了一个新的虚拟终端<br />
此时在上边执行的程序，如果遇到服务器断线是不会中断的，依然会在后台运行<br />
当新的ssh连接到服务器后，执行screen -x 就可以连接到刚才的终端了</span></p>
<p><span style="font-size: small;">此外，利用screen建立的终端，还具有实时演示的效果。<br />
比如两个用户A和B，分别从北京和上海使用SSH连接到一个服务器<br />
A先执行Screen建立好虚拟终端，B执行screen -x连接上来<br />
这时候的虚拟终端是唯一的，就像二人都在显示器前一样<br />
A键入的命令和显示的结果，B都可以实施看到<br />
B键入的命令和输入结果，A也可以实施看到<br />
因此，利用Screen，还可以进行远程操作演示、培训等</span></p>
<p><span style="font-size: small;">注意：<br />
1) 如果多次执行screen，则会建立多个虚拟终端。<br />
当执行screen -x的时候，则会被询问，要连接到哪一个虚拟终端，如下所示：</span></p>
<p><span style="font-size: small;">[root@idc root]# screen -x<br />
There are several suitable screens on:<br />
1408.pts-0.idc  (Attached)<br />
1382.pts-4.idc  (Attached)<br />
Type "screen [-d] -r [pid.]tty.host" to resume one of them.<br />
[root@idc root]# </span></p>
<p><span style="font-size: small;">这个时候，要执行screen -x &lt;终端名&gt;，就可以连接到需要的终端，例如<br />
screen -x 1382.pts-4.idc，即可连接到名为1382.pts-4.idc的虚拟终端上。</span></p>
<p><span style="font-size: small;">2) 退出虚拟终端的方法：首先用screen -x连接到终端，然后执行exit即可退出当前终端。 </span></p>
<p><span style="font-size: small;">转载自：http://hi.baidu.com/grayker/blog/item/7d27d5a21f9ba5aacaefd063.html<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/97/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>我的ssh为什么连接很慢呢？</title>
		<link>http://www.187299.com/archives/102</link>
		<comments>http://www.187299.com/archives/102#comments</comments>
		<pubDate>Thu, 16 Apr 2009 00:57:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.momati.net/archives/102</guid>
		<description><![CDATA[我的ssh在登录的时候总是很慢，我说的是第一次连接的时候很慢（大概要等20多秒），等到连接上就快了（我是用debian来登录centos）我想问问这是为什么？防火墙么？ 怎么来调整他呢？ 1、我前... ]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: small;">我的ssh在登录的时候总是很慢，我说的是第一次连接的时候很慢（大概要等20多秒），等到连接上就快了（我是用debian来登录centos）我想问问这是为什么？防火墙么？ 怎么来调整他呢？</span></p>
<p><span style="font-size: small;">1、我前两天也遇到这个问题了。<br />
网关上绑的IP--MAC是错的，所以慢的很！<br />
把网关上修改正确之后，登录就快了。</span></p>
<p><span style="font-size: small;"><span id="more-102"></span><br />
</span></p>
<p><span style="font-size: small;">2、搞不好是DNS反向解析的问题。</span></p>
<p><span style="font-size: small;">sed -i "s/#UseDNS yes/UseDNS no/"  /etc/ssh/sshd_config</span></p>
<p><span style="font-size: small;">转载自：CU论坛：http://linux.chinaunix.net/bbs/thread-1096922-1-1.html</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/102/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>F-Secure SSH Client用Key方式登录远程Linux</title>
		<link>http://www.187299.com/archives/116</link>
		<comments>http://www.187299.com/archives/116#comments</comments>
		<pubDate>Thu, 02 Apr 2009 05:14:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.momati.net/archives/116</guid>
		<description><![CDATA[用的是F-Secure SSH Client 5.4 Build 56,一直用使用密码方式登录，今天尝试使用Public Key方式，费了一番周折才搞掂： 一、生成key，方法有2： 1、打开F-Secure SSH Client，Edit--&#62;Settings--&#62;Global settings--&... ]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: small;"> 用的是F-Secure SSH Client 5.4 Build 56,一直用使用密码方式登录，今天尝试使用Public Key方式，费了一番周折才搞掂：</span></p>
<p><span style="font-size: small;">一、生成key，方法有2：<br />
1、打开F-Secure SSH Client，Edit--&gt;Settings--&gt;Global settings--&gt;User Keys--&gt;Generate New Keypair,会弹出一个窗口，下一步,Key Type选择RSA，下一步，会有一个生成Key的过程，黑框里的内容不再变化时，点击下一步，如果想增加安全性，即在使用证书的情况下，还使用密码，则在Passphrase和Again里输入密码，本例选择留空，继续下一步，点击“是”，点击完成。点击“OK”。</span></p>
<p><span style="font-size: small;"><span id="more-116"></span><br />
</span></p>
<p><span style="font-size: small;">2、去到F-Secure SSH Client的安装目录，如本例中的D:\Program Files\SSHF-Secure&gt;，键入ssh-keygen2.exe -t rsa，按两次回车，OK。</span></p>
<p><span style="font-size: small;">二、上传Public Key,去到用户目录下，本例中是/home/test,查看目录下有没有.ssh目录，如果没有则新建一个，<br />
$ ls -a</span></p>
<p><span style="font-size: small;">$ mkdir .ssh</span></p>
<p><span style="font-size: small;">将生成的id_rsa_2048_a.pub上传到此目录，因为Linux系统是用OPENSSH作为ssh server，所以此处要对id_rsa_2048_a.pub进行转换<br />
$ ssh-keygen -i -f id_rsa_2048_a.pub &gt;&gt; authorized_keys</span></p>
<p><span style="font-size: small;"> 大功告成了，现在不用密码都可以登录了。</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/116/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

