﻿<?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; git</title>
	<atom:link href="https://www.softwareace.cn/?cat=111&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>https://www.softwareace.cn</link>
	<description>时刻想着为自己的产品多做一些对他好的事情</description>
	<lastBuildDate>Fri, 20 Mar 2026 06:58:28 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>GitLab修改root用户密码</title>
		<link>https://www.softwareace.cn/?p=1752</link>
		<comments>https://www.softwareace.cn/?p=1752#comments</comments>
		<pubDate>Tue, 17 Apr 2018 06:47:20 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=1752</guid>
		<description><![CDATA[GitLab是一个私有的Git仓库，具有较好的项目管理和用户管理能力。 对于普通用户而言，通过系统的重置密码， [&#8230;]]]></description>
				<content:encoded><![CDATA[<p style="color: #4f4f4f;">GitLab是一个私有的Git仓库，具有较好的项目管理和用户管理能力。<br />
对于普通用户而言，通过系统的重置密码，接受邮件即可解决，可是GitLab的管理员账号，缺省的邮箱是一个不存在的邮箱地址，所以没有办法通过邮箱来复位。<br />
通过在服务器上，可以修改用户的密码：<br />
官方修改密码：(<a style="color: #6795b5;" href="http://docs.gitlab.com/ce/security/reset_root_password.html" target="_blank">http://docs.gitlab.com/ce/security/reset_root_password.html</a>)<br />
不过，笔者通过该方法是，发现，不能使用引号来包括密码。<br />
具体方法如下：<br />
1. 在root用户下，执行</p>
<p></p><pre class="crayon-plain-tag">gitlab-rails console production</pre><p>&nbsp;</p>
<ol style="color: #454545;">
<li>获得用户数据，修改用户密码</li>
<li>
<pre class="crayon-plain-tag">[root@svr34 bin]# gitlab-rails console production
Loading production environment (Rails 4.2.5.2)
irb(main):001:0&gt; user = User.where(id: 1).first
=&gt; #&lt;User id: 1, email: "admin@example.com", ...
irb(main):002:0&gt; user.password=12345678
=&gt; 12345678
irb(main):003:0&gt; user.password_confirmation=12345678
=&gt; 12345678
irb(main):004:0&gt; user.save!
=&gt; true
irb(main):005:0&gt; quit</pre><br />
&nbsp;</li>
</ol>
<p style="color: #4f4f4f;">注意：<span style="font-weight: bold;">密码没有使用引号</span>，奇怪的是使用单引号或双引号，密码就无效，估计是包含了这个字符，不包含，就没有问题。<br />
3. 保存用户数据</p>
<p></p><pre class="crayon-plain-tag">user.save!</pre><p></p>
<p style="color: #4f4f4f;">注意需要使用后面的<span style="font-weight: bold;">感叹号!</span></p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=1752</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>no matching key exchange method found. Their offer: diffie-hellman-group1-sha1</title>
		<link>https://www.softwareace.cn/?p=1599</link>
		<comments>https://www.softwareace.cn/?p=1599#comments</comments>
		<pubDate>Mon, 06 Mar 2017 03:39:40 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=1599</guid>
		<description><![CDATA[解决：修改~/.ssh/config，加入 [crayon-69e51f6d6803f946682950/]  [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>解决：修改~/.ssh/config，加入</p><pre class="crayon-plain-tag">Host *
    KexAlgorithms +diffie-hellman-group1-sha1</pre><p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=1599</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
