<?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 | SDT 攻城獅區</title>
	<atom:link href="https://sdt.hameba.tw/tag/ssh/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>ssh | 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>
		<item>
		<title>Git local init push to remote branch</title>
		<link>https://sdt.hameba.tw/498/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=git-local-init-push-to-remote-branch</link>
				<comments>https://sdt.hameba.tw/498/#respond</comments>
				<pubDate>Mon, 27 Jan 2020 04:08:16 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git init]]></category>
		<category><![CDATA[git remote]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=498</guid>
				<description><![CDATA[<p>有時開專案會先在本地端做測試，而開啟專案commit一些init資訊， 當你將本機端的 Git 加入到遠端的  &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/498/" class="more-link">閱讀全文<span class="screen-reader-text">〈Git local init push to remote branch〉</span></a></p>
The post <a href="https://sdt.hameba.tw/498/">Git local init push to remote branch</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>有時開專案會先在本地端做測試，而開啟專案commit一些init資訊，</p>
<p>當你將本機端的 Git 加入到遠端的 repository 像是 GitHub …等，若之後你又另外建立新的的 repository 或是要將它搬移至其他遠端數據庫例如 GitLab。此時要刪除原本的 remote origin 該怎麼做？</p>
<p><span id="more-498"></span></p>
<p>可參考以下方式</p><pre class="crayon-plain-tag"># 專案引入git功能
$ git init

# commit 一些記錄點後
$ git add .
$ git commit -m "[INIT] Add react."
...
$ git commit -m "[INIT] Add react-router."
...
...

# 當測試完成後想要跟遠端專案做link的方式
# ssh
$ git remote add origin ssh://&lt;username&gt;@bitbucket.org/&lt;username&gt;/&lt;project&gt;

# or https
$ git remote add origin https://&lt;username&gt;@bitbucket.org/&lt;username&gt;/&lt;project&gt;

# 移除 remote
$ git remote remove origin

# 觀看目前git remote設定
$ git remote -v

# 設定local分支與遠端分支對齊
$ git branch --set-upstream-to=origin/master master

# 設定push資訊
$ git push -u
$ git push --set-upstream origin master</pre><p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://stackoverflow.com/questions/42122191/git-initialize-and-push-local-repository-to-remote-not-found" target="_blank" rel="noopener noreferrer">https://stackoverflow.com/questions/42122191/git-initialize-and-push-local-repository-to-remote-not-found</a></p>
<p><a href="https://andy6804tw.github.io/2019/01/04/git-remove-remote/" target="_blank" rel="noopener noreferrer">https://andy6804tw.github.io/2019/01/04/git-remove-remote/</a></p>The post <a href="https://sdt.hameba.tw/498/">Git local init push to remote branch</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/498/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
