<?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>深度VPS &#187; 密钥</title>
	<atom:link href="http://www.deepvps.com/tag/%E5%AF%86%E9%92%A5/feed" rel="self" type="application/rss+xml" />
	<link>http://www.deepvps.com</link>
	<description>专注VPS技术，关注前端技术</description>
	<lastBuildDate>Sat, 04 Feb 2023 14:00:33 +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>Liunx vps 设置SSH通过密钥登录</title>
		<link>http://www.deepvps.com/set-ssh-login-key.html</link>
		<comments>http://www.deepvps.com/set-ssh-login-key.html#comments</comments>
		<pubDate>Sat, 04 Feb 2023 13:59:08 +0000</pubDate>
		<dc:creator>deepvps</dc:creator>
				<category><![CDATA[VPS管理维护]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[密钥]]></category>
		<category><![CDATA[登录]]></category>

		<guid isPermaLink="false">http://www.deepvps.com/?p=1663</guid>
		<description><![CDATA[前言：
SSH 密钥是一种更安全的登录SSH 服务器的方法，因为它们不易受到常见的暴力密码黑客攻击，
尽管SSH 支持基于密码的身份验证，但通常建议使用SSH 密钥，
生成SSH 密钥对会创建两个长字符串：公钥和私钥，
可以将公钥放在任何服务器上，然后使用可以访问私钥的SSH 客户端连接到服务器。
服务器上使用 ssh 密钥登录
本地客户端生成密钥对
使用下面命令生成密钥对：
ssh-keygen -t rsa -P
-P 表示空密码，一路回车，在 .ssh 目录会生成下面三个文件
cd ~/.ssh &#38;&#38; ls
id_rsa id_rsa.pub known_hosts
id_rsa： 表示私钥，不要泄露
id_rsa.pub： 表示公钥
查看公钥内容，然后复制下来或者将两个文件下载下来：
cat ~/.ssh/id_rsa.pub
上面客户端完成，开始折腾服务端
服务端新建authorized_keys
root目录下新建 .ssh 文件夹
mkdir /root/.ssh
.ssh 文件夹新建 authorized_keys 文件
vi /root/.ssh/authorized_keys
上面添加客户端复制下来的 id_rsa.pub 内容，保存。
修改 sshd_config 内容
vi /etc/ssh/sshd_config
禁用密码登陆
PasswordAuthentication no
允许root用户登录
PermitRootLogin yes
指定公钥数据库文件
AuthorsizedKeysFile .ssh/authorized_keys
以启用密钥登陆
PubkeyAuthentication yes
防ssh断开
ClientAliveInterval 60
ClientAliveCountMax 30
最后重启 sshd 服务：
systemctl restart sshd
然后你就可以用 ssh 命令无密码登录服务器了 
]]></description>
			<content:encoded><![CDATA[<h2 id="0-0">前言：</h2>
<p>SSH 密钥是一种更安全的登录SSH 服务器的方法，因为它们不易受到常见的暴力密码黑客攻击，<br />
尽管SSH 支持基于密码的身份验证，但通常建议使用SSH 密钥，<br />
生成SSH 密钥对会创建两个长字符串：公钥和私钥，<br />
可以将公钥放在任何服务器上，然后使用可以访问私钥的SSH 客户端连接到服务器。<span id="more-1663"></span></p>
<h2 id="0-0">服务器上使用 ssh 密钥登录</h2>
<h3>本地客户端生成密钥对</h3>
<h3>使用下面命令生成密钥对：</h3>
<p><code>ssh-keygen -t rsa -P</code></p>
<h3>-P 表示空密码，一路回车，在 .ssh 目录会生成下面三个文件</h3>
<p><code>cd ~/.ssh &amp;&amp; ls</code></p>
<p><code>id_rsa id_rsa.pub known_hosts</code></p>
<h5>id_rsa： 表示私钥，不要泄露</h5>
<h5>id_rsa.pub： 表示公钥</h5>
<h4>查看公钥内容，然后复制下来或者将两个文件下载下来：</h4>
<p><code>cat ~/.ssh/id_rsa.pub</code></p>
<h3>上面客户端完成，开始折腾服务端</h3>
<h2 id="0-0">服务端新建authorized_keys</h2>
<p>root目录下新建 .ssh 文件夹</p>
<p><code>mkdir /root/.ssh</code></p>
<p>.ssh 文件夹新建 authorized_keys 文件</p>
<p><code>vi /root/.ssh/authorized_keys</code></p>
<p>上面添加客户端复制下来的 id_rsa.pub 内容，保存。</p>
<h2 id="0-0">修改 sshd_config 内容</h2>
<p><code>vi /etc/ssh/sshd_config</code></p>
<h2 id="0-0">禁用密码登陆</h2>
<p><code>PasswordAuthentication no</code></p>
<h2 id="0-0">允许root用户登录</h2>
<p><code>PermitRootLogin yes</code></p>
<h2 id="0-0">指定公钥数据库文件</h2>
<p><code>AuthorsizedKeysFile .ssh/authorized_keys</code></p>
<h2 id="0-0">以启用密钥登陆</h2>
<p><code>PubkeyAuthentication yes</code></p>
<h2 id="0-0">防ssh断开</h2>
<p><code>ClientAliveInterval 60</code><br />
<code>ClientAliveCountMax 30</code></p>
<h2 id="0-0">最后重启 sshd 服务：</h2>
<p><code>systemctl restart sshd</code></p>
<h3>然后你就可以用 ssh 命令无密码登录服务器了 <img src="https://www.nodeseek.com/static/image/sticker/xhj/019.gif" alt="" /></h3>
]]></content:encoded>
			<wfw:commentRss>http://www.deepvps.com/set-ssh-login-key.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH证书让Putty免密码登陆Linux</title>
		<link>http://www.deepvps.com/sshcertificate-putty-linux.html</link>
		<comments>http://www.deepvps.com/sshcertificate-putty-linux.html#comments</comments>
		<pubDate>Fri, 21 May 2010 04:51:36 +0000</pubDate>
		<dc:creator>deepvps</dc:creator>
				<category><![CDATA[VPS管理维护]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[密钥]]></category>
		<category><![CDATA[证书]]></category>

		<guid isPermaLink="false">http://www.deepvps.com/?p=438</guid>
		<description><![CDATA[PUTTY默认不支持记住密码,修改版的还是不要用,好在SSH支持证书登陆,我也问了生产环境下的朋友,他们登陆SSH也是用证书.
这里介绍的不是双Linux环境下的SSH证书登陆,而是Windows下用Putty证书登陆至你的Linux服务器/VPS.
目前我用的是Putty中文版,来自GoogleCode的项目:http://code.google.com/p/puttycn/
1.用PuTTY SSH 密钥生成工具puttygen.exe生成密钥.
生成的密钥类型和位数按照默认的就OK，SSH-2 RSA，1024位
生成密钥时你需要在空白区域移动鼠标,以便产生随机数据
点击保存私钥(可以不设置密码保护),不要生成公钥,因为PUTTY生成的公钥OpenSSH无法使用.
2.SSH密码方式登入远端Linux服务器/VPS,创建.ssh/authorized_keys.
vim ~/.ssh/authorized_keys
将puttygen.exe生成的公钥内容粘贴至~/.ssh/authorized_keys.
注:公钥内容就在显示的公钥(P)由OpenSSH认可: 这行字符下面.
至于为什么文件名是authorized_keys,可以在/etc/ssh/sshd_config中找到下面两行
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
3.用SSH证书登陆你的Linux服务器/VPS
Putty→会话:将服务器IP填好
Putty→连接→数据:填好自动登陆用户名
Putty→连接→SSH→认证:选择认证私钥文件
回到Putty→会话:保存的会话,填个名称保存下吧,下次直接双击名称就可以登录了,赶紧登录吧.
4.为了安全你需要取消SSH的密码认证方式.
vim /etc/ssh/sshd_config
添加下面这行
PasswordAuthentication no
重启SSH服务
service sshd restart
转自： SSH证书让Putty免密码登陆Linux
]]></description>
			<content:encoded><![CDATA[<p>PUTTY默认不支持记住密码,修改版的还是不要用,好在SSH支持证书登陆,我也问了生产环境下的朋友,他们登陆SSH也是用证书.</p>
<p>这里介绍的不是双Linux环境下的SSH证书登陆,而是Windows下用Putty证书登陆至你的Linux服务器/VPS.</p>
<p>目前我用的是Putty中文版,来自GoogleCode的项目:<a href="http://code.google.com/p/puttycn/" target="_blank">http://code.google.com/p/puttycn/</a><span id="more-438"></span></p>
<p><strong>1.用PuTTY SSH 密钥生成工具puttygen.exe生成密钥.</strong></p>
<p>生成的密钥类型和位数按照默认的就OK，SSH-2 RSA，1024位</p>
<p>生成密钥时你需要在空白区域移动鼠标,以便产生随机数据</p>
<p>点击保存私钥(可以不设置密码保护),不要生成公钥,因为PUTTY生成的公钥OpenSSH无法使用.</p>
<p><strong>2.SSH密码方式登入远端Linux服务器/VPS,创建.ssh/authorized_keys.</strong></p>
<blockquote><p>vim ~/.ssh/authorized_keys</p></blockquote>
<p>将puttygen.exe生成的公钥内容粘贴至~/.ssh/authorized_keys.</p>
<p>注:公钥内容就在显示的公钥(P)由OpenSSH认可: 这行字符下面.</p>
<p>至于为什么文件名是authorized_keys,可以在/etc/ssh/sshd_config中找到下面两行</p>
<blockquote><p>#PubkeyAuthentication yes<br />
#AuthorizedKeysFile .ssh/authorized_keys</p></blockquote>
<p><strong>3.用SSH证书登陆你的Linux服务器/VPS</strong></p>
<p>Putty→会话:将服务器IP填好</p>
<p>Putty→连接→数据:填好自动登陆用户名</p>
<p>Putty→连接→SSH→认证:选择认证私钥文件</p>
<p>回到Putty→会话:保存的会话,填个名称保存下吧,下次直接双击名称就可以登录了,赶紧登录吧.</p>
<p><strong>4.为了安全你需要取消SSH的密码认证方式.</strong></p>
<blockquote><p><code id="code0">vim /etc/ssh/sshd_config</code></p></blockquote>
<p>添加下面这行</p>
<blockquote><p>PasswordAuthentication no</p></blockquote>
<p>重启SSH服务</p>
<blockquote><p>service sshd restart</p></blockquote>
<p>转自： <a href="http://www.shocr.com/sshcertificate-putty-linux/" target="_blank">SSH证书让Putty免密码登陆Linux</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deepvps.com/sshcertificate-putty-linux.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
