<?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>Tech Notes &#187; crypt</title>
	<atom:link href="http://www.ryannitz.org/tech-notes/tag/crypt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ryannitz.org/tech-notes</link>
	<description>Miscellaneous technology examples and notes</description>
	<lastBuildDate>Sun, 03 Apr 2011 16:48:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<image>
  <link>http://www.ryannitz.org/tech-notes</link>
  <url>http://ryan-nitz/favicon.ico</url>
  <title>Tech Notes</title>
</image>
		<item>
		<title>Linux &#8211; Programmatically Change Password</title>
		<link>http://www.ryannitz.org/tech-notes/2008/08/06/linux-programatically-change-password/</link>
		<comments>http://www.ryannitz.org/tech-notes/2008/08/06/linux-programatically-change-password/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 00:22:00 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[crypt]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[usermod]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=36</guid>
		<description><![CDATA[If you need to script a password change you have two main options: Write a script that interacts with the command line and executes passwd Use the usermod command Option one is a bit of a mess and option two requires an encrypted version of the password. At first, we couldn&#8217;t figure out how to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ryannitz.org/tech-notes/wp-content/uploads/2008/08/linux.jpeg"><img class="alignnone size-medium wp-image-42" title="linux" src="http://www.ryannitz.org/tech-notes/wp-content/uploads/2008/08/linux.jpeg" alt="" width="113" height="124" /></a></p>
<p>If you need to script a password change you have two main options:</p>
<ol>
<li>Write a script that interacts with the command line and executes <a href="http://en.wikipedia.org/wiki/Passwd_%28command%29" target="_blank">passwd<br />
</a></li>
<li>Use the <a href="http://linux.die.net/man/8/usermod" target="_blank">usermod</a> command</li>
</ol>
<p>Option one is a bit of a mess and option two requires an encrypted version of the password. At first, we couldn&#8217;t figure out how to encrypt the password but then we realized that you could use the <a href="http://perldoc.perl.org/functions/crypt.html" target="_blank">Perl crypt</a> function.</p>
<p>An example of number two:</p>
<pre>#!/bin/bash

usermod -p `perl -e 'print crypt("test", "salt")'` root;</pre>
<p>That&#8217;s all there is to it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2008/08/06/linux-programatically-change-password/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

