<?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>without password | SDT 攻城獅區</title>
	<atom:link href="https://sdt.hameba.tw/tag/without-password/feed/" rel="self" type="application/rss+xml" />
	<link>https://sdt.hameba.tw</link>
	<description>由Steven, Der, Ted 三位高級打字員所組成，是三位工程師(攻城獅)所維護的技術分享平台，或許偶爾會分享一些日常，有任何問題或是錯誤的部分，歡迎留言告訴我們！</description>
	<lastBuildDate>Fri, 28 Feb 2020 08:16:43 +0800</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.3</generator>

<image>
	<url>https://sdt.hameba.tw/wp-content/uploads/2020/02/hameba_favicon-150x150.png</url>
	<title>without password | SDT 攻城獅區</title>
	<link>https://sdt.hameba.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>ssh 登入 遠端電腦不用密碼</title>
		<link>https://sdt.hameba.tw/588/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ssh-%25e7%2599%25bb%25e5%2585%25a5-%25e9%2581%25a0%25e7%25ab%25af%25e9%259b%25bb%25e8%2585%25a6%25e4%25b8%258d%25e7%2594%25a8%25e5%25af%2586%25e7%25a2%25bc</link>
				<comments>https://sdt.hameba.tw/588/#respond</comments>
				<pubDate>Fri, 28 Feb 2020 08:16:43 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[CI/CD]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[without password]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=588</guid>
				<description><![CDATA[<p>最近做jenkins CI/CD 要跨內部server發現登入ssh需要密碼， 真的滿麻煩，也不能在shell &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/588/" class="more-link">閱讀全文<span class="screen-reader-text">〈ssh 登入 遠端電腦不用密碼〉</span></a></p>
The post <a href="https://sdt.hameba.tw/588/">ssh 登入 遠端電腦不用密碼</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>最近做jenkins CI/CD 要跨內部server發現登入ssh需要密碼，</p>
<p>真的滿麻煩，也不能在shellscript把密碼直接放入，<span id="more-588"></span></p>
<p>只好讓兩台server client -&gt; server 免除認證，</p>
<p>步驟1. 至client server(這邊對我來說是jenkins這台server)</p><pre class="crayon-plain-tag">//client 建立自己的ssh ras憑證
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
c3:e9:25:65:00:c8:65:cb:e8:fe:4e:7e:ce:06:a4:9d root@kvm8.deyu.wang
The key's randomart image is:
+--[ RSA 2048]----+
|   . o+..        |
|    o+ . .       |
|    . o   o      |
|   .  .. +       |
|    .+ .S .      |
|   .. E. +       |
|    . ...        |
|     + .o        |
|     .++o        |
+-----------------+

// 將client的pub放到server，該user 家目錄下
$ scp ~/.ssh/id_rsa.pub serverUser@serverIP:~/</pre><p>步驟2. 切換到 目標Server</p><pre class="crayon-plain-tag">// ssh 目標server，這時進去還需要需入密碼
$ ssh serverUser@serverIP

// 把剛剛client傳過來的id_rsa.pub寫入authorized_keys
$ cat ~/id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys

// 離開
$ exit

// 測試ssh連線，如設定成功，就不需要密碼即可以進入
$ ssh serverUser@serverIP</pre><p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://dywang.csie.cyut.edu.tw/dywang/security/node84.html" target="_blank" rel="noopener noreferrer">https://dywang.csie.cyut.edu.tw/dywang/security/node84.html</a></p>The post <a href="https://sdt.hameba.tw/588/">ssh 登入 遠端電腦不用密碼</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/588/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
