<?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>Technical LeoLo &#187; FreeBSD</title>
	<atom:link href="http://blog.leolo.cc/topics/os/freebsd-os/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.leolo.cc</link>
	<description>My Learning note</description>
	<lastBuildDate>Thu, 12 Mar 2009 08:58:42 +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>FreeBSD帳號密碼轉移至Linux</title>
		<link>http://blog.leolo.cc/2006/08/10/6/</link>
		<comments>http://blog.leolo.cc/2006/08/10/6/#comments</comments>
		<pubDate>Wed, 09 Aug 2006 21:48:00 +0000</pubDate>
		<dc:creator>leolo</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[transfer]]></category>

		<guid isPermaLink="false">http://leolo.wordpress.com/2006/08/10/freebsd%e5%b8%b3%e8%99%9f%e5%af%86%e7%a2%bc%e8%bd%89%e7%a7%bb%e8%87%b3linux/</guid>
		<description><![CDATA[FreeBSD的帳號密碼及其他資訊都存在master.passwd，Linux則分別存在passwd及shadow中。
master.passwd@FreeBSD
帳號：密碼：UID：GID：Login Class：Change：Expire：Full Name：家目錄：Login SHELL

Login Class：幾乎沒在用了,通常是空的
Change：強迫使用者改密碼的時間週期, 0 表示不設定
Expire：使用者帳號的使用期限, 0 表示不設定

passwd@Linux
帳號：密碼：UID：GID：Full Name：家目錄：Login SHELL
FreeBSD比Linux多了三個欄位
所以我們將那三個欄位捨棄，並把密碼那欄設為x，因為Linux的密碼是存在shadow
cat master.passwd.bsd &#124; awk -F":" '$3&#62;=1002&#38;&#38;$3 passwd.linux
shadow@Linux
帳號：密碼：3：4：5：6：7：8：9

3.last password change
4.days until change allowed
5.days before change required
6.days warning for expiration
7.days before account inactive
8.date when account expires
9.reserved for future use

接著處理shadow
cat master.passwd.bsd &#124; awk -F":" '$3&#62;=1002&#38;&#38;$3 shadow.linux
再來處理group
cat group.bsd &#124; awk -F":" '$3 &#62;=1002&#38;&#38;$3 group.linux
接著把他們附加到原本的檔案後面

cat shadow.linux &#62;&#62; /etc/shadow
cat passwd.linux &#62;&#62; [...]]]></description>
		<wfw:commentRss>http://blog.leolo.cc/2006/08/10/6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
